July 10, 2005 at 6:11 pm
How deep does NOLOCK, go for example,
View1 = SELECT * FROM dbo.authors
View2 = SELECT Name FROM View1 GROUP BY Name
View3 = SELECT * FROM View2 WITH (NOLOCKS)
Does the NOLOCK in view3 go back to the original dbo.authors table and remove locks for field "name" or all fields, or does it not go beyond view2 ????
July 10, 2005 at 7:07 pm
The locks that SQL Server acquires are on the base data. Unless you are using indexed views, there is no data in the views to place locks on.
Using NOLOCK will remove the Intent Shared locks on the authors table that a select would acquire. You would still see some schema locks for each of the objects referenced. The schema locks are used to ensure the views remain valid while the query is executing.
Check "Understanding Locking in SQL Server" in Books Online for detailed information.
--------------------
Colt 45 - the original point and click interface
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply