dbTalk Databases Forums  

DTS - sleep

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss DTS - sleep in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
\Sokrates\
 
Posts: n/a

Default DTS - sleep - 12-01-2003 , 10:32 AM






Hi,

Can you please tell me why this wont work in an ActiveX task in a DTS
package...?
---
Function Main()
set WshShell = CreateObject("WScript.Shell")
WScript.Sleep 1800000
set WshShell = nothing

Main = DTSTaskExecResult_Success
End Function
---

Basically I need to wait 30 mins withing a DTS package - could I do this
like in VBS/JS/ActiveX somehow?

Best regards
Jakob



Reply With Quote
  #2  
Old   
Darren Green
 
Posts: n/a

Default Re: DTS - sleep - 12-01-2003 , 12:34 PM






In article <ekuDFjCuDHA.2308 (AT) TK2MSFTNGP11 (DOT) phx.gbl>, Sokrates
<someone (AT) somewhere (DOT) com> writes
Quote:
Hi,

Can you please tell me why this wont work in an ActiveX task in a DTS
package...?
---
Function Main()
set WshShell = CreateObject("WScript.Shell")
WScript.Sleep 1800000
set WshShell = nothing

Main = DTSTaskExecResult_Success
End Function
---

Basically I need to wait 30 mins withing a DTS package - could I do this
like in VBS/JS/ActiveX somehow?

Best regards
Jakob


WScript is an implicit object available in the WSH host. You are not
running under WSH, although you are using the same language. Your host
is the DTS ActiveX Script host, which does not the WScript object, it
offers things like DTSGlobalVariables instead.

One downside of this is that Sleep is not exposed as an object method on
something that you can create, so you cannot call it in an DTS ActiveX
Script.

Your syntax is actually trying to call the Sleep method of the Shell
object, but that does not exist, since Sleep is only exposed on the
implicit WScript under WSH.


How about using an Execute SQL Task and the T-SQL WAITFOR statement.


--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org



Reply With Quote
  #3  
Old   
\Sokrates\
 
Posts: n/a

Default Re: DTS - sleep - 12-01-2003 , 01:27 PM



Aahh nice - did'nt know the WAITFOR command - I'll use it with DELAY then,
thanx alot!

Best regards
Jakob


"Darren Green" <darren.green (AT) reply-to-newsgroup-only (DOT) uk.com> skrev i en
meddelelse news:dCXzZvAhm4y$EwXd (AT) sqldts (DOT) com...
Quote:
In article <ekuDFjCuDHA.2308 (AT) TK2MSFTNGP11 (DOT) phx.gbl>, Sokrates
someone (AT) somewhere (DOT) com> writes
Hi,

Can you please tell me why this wont work in an ActiveX task in a DTS
package...?
---
Function Main()
set WshShell = CreateObject("WScript.Shell")
WScript.Sleep 1800000
set WshShell = nothing

Main = DTSTaskExecResult_Success
End Function
---

Basically I need to wait 30 mins withing a DTS package - could I do this
like in VBS/JS/ActiveX somehow?

Best regards
Jakob



WScript is an implicit object available in the WSH host. You are not
running under WSH, although you are using the same language. Your host
is the DTS ActiveX Script host, which does not the WScript object, it
offers things like DTSGlobalVariables instead.

One downside of this is that Sleep is not exposed as an object method on
something that you can create, so you cannot call it in an DTS ActiveX
Script.

Your syntax is actually trying to call the Sleep method of the Shell
object, but that does not exist, since Sleep is only exposed on the
implicit WScript under WSH.


How about using an Execute SQL Task and the T-SQL WAITFOR statement.


--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.