A SQL Read with NOLOCK, Causes a ALTER Table DDL statement to be Blocked or to Fail

If you are using SQL table hint NOLOCK, you would expect that this hint would always be honoured.

However when reading data from a table this will always cause a schema stability lock (Sch-s); even when the NOLOCK hint is used. The latter schema stability lock will block any data definition language statements (i.e. alter table) that which to change the schema (metadata) of the table that is being read.

Ideally the NOLOCK hint should be renamed to reflect this; perhaps SchemaLockOnly.

This entry was posted in SQL 2008 R2, SQL 2016 and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

What is 10 + 8 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)