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 2000 Forums
 Transact-SQL (2000)
 Running stored procedure without "Time Out"

Author  Topic 

iamsmahd
Yak Posting Veteran

55 Posts

Posted - 2004-12-23 : 00:32:31
Hi all.
I have a stored procedure and when I run it trough VB6.0 after about 45 minutes it stopes with TIME OUT error message.Indeed, It takes about 2 hours for complete run.

How can I escape of this error?

Thank you

sonia

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2004-12-23 : 00:54:08
in your connection string specify timeout to be 0

--edit
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdproconstringx.asp

conn.connectiontimeout=0

--------------------
keeping it simple...
Go to Top of Page

iamsmahd
Yak Posting Veteran

55 Posts

Posted - 2004-12-23 : 01:45:03
Jen,

thank you .what is your opinion ofusing @@Lock_timeOut in stored procedure?



sonia
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2004-12-23 : 02:05:13
Depends what you want the sp to do.
Usually the blocking spid is considered the problem and you kill that rather than the blocked spid.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2004-12-23 : 02:11:40
quote:
Originally posted by iamsmahd

Jen,

thank you .what is your opinion ofusing @@Lock_timeOut in stored procedure?



sonia



depends on how long the sproc should run, problem is it's not only the sproc that's involved, you have external factors like traffic, bandwidth and number of concurrent connections

i usually ask programmers to specify the maximum amount of time needed to run an sproc, but since they can't they just modify the timeout period in the application layer.

--------------------
keeping it simple...
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2004-12-23 : 02:55:53
@@Lock_timeOut doesn't affextthe time an sp runs - only how long a query will wait for a lock.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -