2

I'm getting an SQL query timeout for a simple query:

delete from Prices where Id=123

Id is a PK column. The server is not under high load - something is wrong with few other queries. How can I debug this situation? I use SQL Server Express 2008.

Thank you!

UPD1 Renamed table to match real name.

Nikolay R
  • 957
  • 2
  • 11
  • 22
  • Looks like nothing special in it. Maybe I do not understand it entirely. Clustered index scan, clustered index delete, semi join, assert and delete – Nikolay R Jun 20 '11 at 10:56

2 Answers2

2

If you believe the query is blocking on another you can follow the query from this blog post which shows how to identify what it is blocking on. Once you figure that out you can investigate the query for issues.

Matthew Manela
  • 16,572
  • 3
  • 64
  • 66
  • Thank you for your link. What is a best strategy to catch the problem? Execute some statement in catch(TimeOutException)? – Nikolay R Jun 20 '11 at 10:54
  • 1
    When you think your query is timing out run the diagnostic query from the site I linked to. If the cause of your problem is blocking that query may return results indicated what your query is blocking on. You will be able to see the RequestingText and the BlockingText, which can help you figure out what the two queries are doing that are causing blocking. – Matthew Manela Jun 20 '11 at 15:05
0

You have a table named table? That might be the problem. How are you executing the query? Through SQL Studio? Stored Procedure? SqlCommand?

Steve Wellens
  • 20,506
  • 2
  • 28
  • 69
  • No. Table name is Prices. I use Spring.NET HibernateTemplate.Delete. Maybe something is wrong with Spring.NET... – Nikolay R Jun 20 '11 at 10:43