Solved

sql executing timeout

Posted on 2014-02-14
4
263 Views
Last Modified: 2014-02-16
Hello,
In SQL server manager I was deleting rows from a table.  When I returned an hour later it was still executing even though the rows that should be deleted were only about 2000.
While it was executing other calls to the database timed out, so that users could not login to my website.  The reason may be that it could not delete a row because of foreign key.
Why did it continue to execute and not stop? Can I change the sql settings so this does not happen again? I am using sql 2008.
0
Comment
Question by:johnson1
  • 2
  • 2
4 Comments
 
LVL 16

Expert Comment

by:Surendra Nath
ID: 39860178
there may be various reasons why SQL Server took that much amount of time to delete such a small data

The most probables one are listed below in the high to low probablity factor

1) The table that you are deleted is locked by some other user
2) An explict transasction is opened by an user in another SSMS window and left it open
3) The Forieghn key constraint table has a huge data in the underlying tables probably millions
4) the foreighn key constraint table is locked...
0
 

Author Comment

by:johnson1
ID: 39861196
Thank you Surendra. Is it possible to have sql stop executing if it exceeds certain timelimit?
0
 
LVL 16

Accepted Solution

by:
Surendra Nath earned 500 total points
ID: 39861200
if the SQL is triggered from an application code (for example .Net / Java)... then yes the SQL can be stopped by adding connectionTimeOut property in the connection string.

But if the SQL is triggered in SSMS, you can use the below tuotorial to do the same

http://www.hosting.com/support/sql/configure-query-timeout-period-in-sql-management-studio/
0
 

Author Closing Comment

by:johnson1
ID: 39863102
Thank you
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question