Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2803
  • Last Modified:

Wait 10 seconds in DTS package

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
jjrr007
Asked:
jjrr007
  • 5
  • 3
  • 3
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
0
 
Anthony PerkinsCommented:
You can also write some ActiveX code in an ActiveX Script Task.
0
 
jjrr007Author Commented:
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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

In a ActiveX Script Step:
 WScript.Sleep(10000)
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
correct:

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Sleep(10000)
0
 
jjrr007Author Commented:
Is this for ten seconds?

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Sleep(10000)
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
yes. the argument of Sleep is in milliseconds.
0
 
jjrr007Author Commented:
Angel,

I tried that and got object required.  I tried to declare it using Dim, I got WScript method not allowed.  Please advise...
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
I should start rereading my comments before posting :-)

dim WshShell
Set WshShell = CreateObject("WScript.Shell")
WshShell.Sleep(10000)
0
 
Anthony PerkinsCommented:
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
 
Anthony PerkinsCommented:
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 5
  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now