Solved

sql executing timeout

Posted on 2014-02-14
4
249 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thank you
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now