Solved

sql executing timeout

Posted on 2014-02-14
4
276 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

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 …
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

636 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