I'm running a simple select on a table with a small amount of rows, and it's running for forever. I found that it returns fine if I run:
SELECT TOP 23 * FROM MyTable ORDER BY 1
However, it hangs forever if I run:
SELECT TOP 24 * FROM MyTable ORDER BY 1
If I run sp_who
or sp_who2
, there is no one blocking. Why does this happen, and how can I fix it?