When you are creating a new index on a table, Table locks are applied for the duration of the index operation. For large tables, index creations can take a longer time and this prevents user access to the table till the index gets created.
However if you want to allow users to access the table even when new indexes are being created, you can do so using the ONLINE option. Here’s a query that shows how:
CREATE NONCLUSTERED INDEX IX_VendorAddress_AddressTypeIDNote: By default, the ONLINE option is set to OFF.
WITH (ONLINE = ON)
Did you like this post?
|subscribe via rss||subscribe via e-mail|
|print this post||follow me on twitter|