Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Strange behavior for insert command

Author  Topic 

Cecilia1997
Starting Member

5 Posts

Posted - 2009-01-15 : 13:28:39
I have an application to call a store procedure which only do one line insert. Today the application returned "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding."

I tried in SQL server for 3 times, then it worked really fast. Anybody has any idea what happened?

Skorch
Constraint Violating Yak Guru

300 Posts

Posted - 2009-01-15 : 13:32:01
Perhaps your application was waiting for a response from the server while the server suffered a connectivity issue. It could be a multitude of things but I doubt the stored procedure is to blame if it only does a single line insert.
Go to Top of Page

Cecilia1997
Starting Member

5 Posts

Posted - 2009-01-15 : 14:13:53
That's the first thing I thought.

However, I used SQL Profiler to catch the call the SQL "EXEC sp", and run the same "EXEC sq" 3 times inside SQL Server Management Studio. The first time it took 1 minutes and 25 second to finish, then I checked the sp, just a insert into command and ran second time, it still took long. Then I checked the table size, it's not a big table. I ran the 3rd time, it's fine. I went back to my application, it's fine too.
Go to Top of Page

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2009-01-15 : 14:32:05
while the SP is running check for blocking. (sp_who2 active) Perhaps other sessions are doing long running queries - blocking your insert.

Be One with the Optimizer
TG
Go to Top of Page

Cecilia1997
Starting Member

5 Posts

Posted - 2009-01-15 : 14:34:20
Thank you.

I'll try sp_who2 next time and see whether there is any blocking.
Go to Top of Page
   

- Advertisement -