SELECT TOP 1 *
FROM URLForPosting WITH(nolock)
WHERE status = 0
ORDER BY newid()
This is the query when I run in code I get timeout, even when I run it at SQL Server I get timeout.
However when I do this
SELECT TOP 1 *
FROM URLForPosting WITH(nolock)
WHERE status = 0
It runs perfectly fine.
Also the first query was running fine until the records for the first 6 lacks records its has total 8 lack now it gives time out? I have created index on status.
Any suggestions?