views:

38

answers:

1

I have SQL Server 2008. I run a query in a table on a database. The weirdest thing keeps happening. I run a simple select statement on the table. I know there are 62 rows in the table but it gets stuck at row 48 and goes on "querying...". Waited already for hours and it didn't move on from there. I only know of two programs, and one reporting service connecting to that particular table and one other user. Does anyone have any idea on what could be causing this and how I could trace the source of the lock on that table?

As a side note, I noted that the logs only had a notice that Autogrow failed the day before I checked. Could this have something to do with it?

+2  A: 

What if you do a

SELECT * FROM YourTable WITH(NOLOCK)

Does it still hang?

Additionally when it does appear to be blocked you can try running

exec sp_who2

And looking in the BlkBy column to see what process is blocking you.

If that doesn't shed any light this article gives some info on some DMVs that might help get some insight into reasons for waits.

Martin Smith
Thanks. Oddly, the whole thing worked out after a day or two but I'm sure that this would come in handy.
Jonn