Solved

WAITFOR DELAY stored procedure timeout expired on SQL Server 2000

Posted on 2008-10-24
4
1,456 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how the fundamental information of how to create a table.

726 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