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
Solved

WAITFOR DELAY stored procedure timeout expired on SQL Server 2000

Posted on 2008-10-24
4
1,443 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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.
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

839 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