For some strange reason, when trying to access the last 100 records of a table, SQL Server MS sits and spins and takes forever to query the results. Selecting the first 100 records comes back really fast (1 s). Any idea what might be going on? Row lock or 开发者_运维问答something else?
That really seems strange.
Thanks.
It sound like another pid has an open transaction holding locks on the table you're trying to read.
In another SSMS window try running DBCC OPENTRAN
(look up the options if this is a higher volume system.
EDIT
+1 to @Martin's comment .... add a nolock
hint to your query for quick and dirty way to test.
SELECT ID
FROM MyTable WITH (nolock)
精彩评论