From: franzbrown on
If I have a select statement that produces no results, what sort of
locks could it still potentially generate?
From: Russell Fields on
Franzbrown,

You can still expect shared locks. I did a query to do a scan of a large
table, but returning no rows, and got:

SELECT * FROM TableName WHERE Column LIKE '%xyz%'

1 - S (Shared) lock
3 - IS (Intent Shared) locks
4 - Sch-S (Schema Stability) locks

SELECT * FROM TableName WITH (NOLOCK) WHERE Column LIKE '%xyz%'

1 - S (Shared) lock
7 - Sch-S (Schema Stability) locks

You can read about the meanings of these locks at:
http://technet.microsoft.com/en-us/library/ms187749.aspx and for more
information http://technet.microsoft.com/en-us/library/ms190615.aspx

RLF

<franzbrown(a)yahoo.com> wrote in message
news:dccb0f83-86a8-4529-a177-7ff54c4827e4(a)z24g2000prf.googlegroups.com...
> If I have a select statement that produces no results, what sort of
> locks could it still potentially generate?