Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Wait 10 seconds in DTS package

Posted on 2006-07-05
11
Medium Priority
?
2,794 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
[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
  • 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
Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

 
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 2000 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

722 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