Solved

WAITFOR DELAY stored procedure timeout expired on SQL Server 2000

Posted on 2008-10-24
4
1,433 Views
Last Modified: 2013-11-30
Hi all.

I have a stored procedure provided in the code snippet. When I run it in my ActiveXScript in my DTS:

oConn.Execute =  "[SDI].dbo.spDelay '0:1:0'"

While testing it, it works fine when the delay is set to 35 seconds: oConn.Execute =  "[SDI].dbo.spDelay '0:0:35'"

But if I put 50 seconds or a minute as provided above, I get an error:

[Microsoft][ODBC SQL Server Driver] TimeOut Expired

I have gone to server --> Properties --> Connections --> and set Query timeout to 0 seconds but I still get the error.

The ActiveXScript sends emails to records in a table, I want the DTS to pause for a minute or 2 in between emails.
CREATE PROCEDURE spDelay (@interval CHAR(9))
AS
WAITFOR DELAY @interval
GO

Open in new window

0
Comment
Question by:printmedia
  • 2
  • 2
4 Comments
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 22796677
I would say that your command timeout in your DTS connection string is set too low then.  Double check the commandtimeout of your oconn connection object.
0
 

Author Comment

by:printmedia
ID: 22796888
Ah, I didn't set the timeout, how can I set it to indefinite, as there may be times where there are 100 emails to send out I wouldn't know how long it would take to send them out.
0
 
LVL 39

Accepted Solution

by:
BrandonGalderisi earned 500 total points
ID: 22797075
oconn.commandtimeout=0
0
 

Author Comment

by:printmedia
ID: 22797272
Great thanks!
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

810 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