Link to home
Start Free TrialLog in
Avatar of johnson1
johnson1

asked on

sql executing timeout

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.
Avatar of Surendra Nath
Surendra Nath
Flag of India image

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...
Avatar of johnson1
johnson1

ASKER

Thank you Surendra. Is it possible to have sql stop executing if it exceeds certain timelimit?
ASKER CERTIFIED SOLUTION
Avatar of Surendra Nath
Surendra Nath
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you