Re: Stored proc timeout issue



I have a stored proc that deletes certain records in half a dozen tables,
one table after another, in a D7 app. The sp creates a temp table at the
beginning with IDs of the records to be deleted. Ado, ms sql server 2k5.

The program Opens the proc and times out after 2 minutes. When I run the
proc from sql server mgmt studio, it completes in 11 seconds.

This suddenly started working, with no apparent reason. I very carefully reviewed the sql server Activity Monitor while I was working and I'm pretty sure no one else has been using the database this morning.

This morning I ran the program function that is the problem, and it timed out (120 seconds). I began diagnosing the problem by commenting out various lines of code in the stored proc (child table deletes, mostly). Each time, I ran the program and it succeeded, and I added back in a few lines. Eventually they were all back in, and the program succeeded. One thing that remained changed was the command timeout value. The program sets the timeout to 120 seconds. Since I was certain the proc would not run that long, I commented out this line during my diagnostic testing.

I have to reiterate in case someone is wondering, using the activity monitor, I checked for blocking, refreshing the display frequently during the 120 second lockup, during the time when the problem existed.

Is it possible that there's a bug in sql 2k5, or could there be corruption in the database? How would I know?

Jeremy

.



Relevant Pages

  • Re: Another Concurrency Issue!!!!
    ... > allocating in blocks, using tables with identities, etc. ... > Columnist, SQL Server Professional ... I have a proc which returns a value after some DML operations on ... >> TIA ...
    (microsoft.public.sqlserver.programming)
  • Re: SQL 2005
    ... The SQL Server implementation is not just Stored Procs, ... it works very tightly in proc with the SQL Server Engine(most ... Now with all that I have said T-SQL is not going away and is still a needed ... >> the CLR is now supported in stored procedures and triggers. ...
    (borland.public.delphi.non-technical)
  • Re: Performance Problem Using ADO and Stored Procs
    ... >I have a stored proc that executes in < 15 seconds through Query Analyzer. ... If I execute this proc ... > of CPU activity on the server hosting SQL server for the SQL server ... > Private Function RunProc(vntDB As Variant, strProcName As String, ...
    (microsoft.public.data.ado)
  • Re: Do UDFs slow down Stored Proc execution?
    ... Tuning the queries of course would be the correct thing to do. ... works beautifully from a business logic perspective. ... I have been plowing through the Microsoft SQL Server 2000 Performance ... I don't know if you actually want to see that proc. ...
    (microsoft.public.sqlserver.programming)
  • Re: Increase Connection Command timeout globally
    ... Hitchhiker's Guide to Visual Studio and SQL Server ... As far as the database connection timing out, if you have a lot of users ... The command ... would justify increasing the command timeout. ...
    (microsoft.public.dotnet.framework.adonet)