Solved

Wait 10 seconds in DTS package

Posted on 2006-07-05
11
2,759 Views
Last Modified: 2013-11-30
Experts,

I am creating a DTS package that uses ActiveX scripts.  What I need is for the DTS package to wait 10 seconds before it goes on to the next step in the DTS package.  

Thanks a lot!  


***You don't need to read below- unless you want further explanation
Using the code "main = DTSTaskExecResult_Success" will not work.  I have to have the DTS package wait 10 seconds, before going on to the next step.  Also, I prefer to have this in one DTS package.

0
Comment
Question by:jjrr007
  • 5
  • 3
  • 3
11 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 17044895
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 17044943
You can also write some ActiveX code in an ActiveX Script Task.
0
 
LVL 1

Author Comment

by:jjrr007
ID: 17045063
How do I incorporate the WAITFOR DELAY '0:00:10'  into the ActiveX Control? Please advise.

I have raised the points, because of the difficulty.  

Thanks!
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 17045162
>WAITFOR DELAY '0:00:10'
that is to be put into a SQL step.

In a ActiveX Script Step:
 WScript.Sleep(10000)
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 17045172
correct:

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Sleep(10000)
0
 
LVL 1

Author Comment

by:jjrr007
ID: 17045385
Is this for ten seconds?

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Sleep(10000)
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 17045414
yes. the argument of Sleep is in milliseconds.
0
 
LVL 1

Author Comment

by:jjrr007
ID: 17045840
Angel,

I tried that and got object required.  I tried to declare it using Dim, I got WScript method not allowed.  Please advise...
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 17045904
I should start rereading my comments before posting :-)

dim WshShell
Set WshShell = CreateObject("WScript.Shell")
WshShell.Sleep(10000)
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 17046174
Sleep is a method that belongs to the WScript object. WScript does not need to be instantiated:

<quote>
The WScript object is the root object of the Windows Script Host object model hierarchy. It never needs to be instantiated before invoking its properties and methods, and it is always available from any script file.
</quote>

So this will work in a VBS script:
WScript.Sleep 3000
MsgBox "Done!"

Having said it does not appear to be available in DTS.

0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 17046348
For a crappy solution (just watch your CPU remain at 100% for 10 seconds) and providing you do not run at midnight, you can use something like this:

Dim Start
Start = Timer
Do While Start + 10 > Timer
Loop

Perhaps you should reconsider and use angelIII solution using WAITFOR DELAY or tell us why you need to wait 10 seconds.
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

756 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