0

I am trying to execute select statement in SSMS 2014. But it is taking too long and not providing any results. I waited for 30 minutes but still I did not receive any result.

Can someone please suggest me the solution for this.

Thank You

Anirudha.I
  • 43
  • 5
  • You can check the executed SQL by select or join some master tables. Check whether deadlock exist. More, use SQL Profiler to have a detail investigation. – daniel Jan 20 '16 at 11:59
  • You should consider the size of tables. Any index? Whether more than 30 minutes must not happen for this query. Also, you can try to see the expected execution plan to see any hints. – daniel Jan 20 '16 at 12:04
  • Estimated Number of rows = 60000. I saw the plan as well. But I am not getting , what exactly the problem is ? because everything was working perfectly yesterday. – Anirudha.I Jan 20 '16 at 13:27
  • One possible reason is that some rows being locked then your query need to wait for them to commit. You can check whether there is any active connection, kill them and retry your query. Or simply restart the server and retry your query. – daniel Jan 20 '16 at 13:47
  • There is a JOB which uses the view I am trying to use and this job is executing for like a day but not successful. Can that be a problem ? – Anirudha.I Jan 20 '16 at 14:04
  • Possible but need to check. Is there any update record action in this job or other job use transaction. Deadlock occurs will make some record being locked, but SQL server will detect deadlock and resolve deadlock by abort the later action in the deadlock by timeout. So, I guess from time to time, your select statement wound success to execute. You can use SQL profiler in SSMS to capture deadlock and resolve the deadlock. – daniel Jan 20 '16 at 18:05

0 Answers0