dbTalk Databases Forums  

How to execute ssis package from .vbs?

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


Discuss How to execute ssis package from .vbs? in the microsoft.public.sqlserver.dts forum.



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

Default How to execute ssis package from .vbs? - 12-12-2006 , 08:59 PM






I am upgrading to SQL 2005. I have a VB script that calls a DTS package
(shown below). Is there a way for a VB script to call a SSIS package? I have
seen posts that mention adding a reference to
Microsoft.SqlServer.ManagedDTS.dll in VB.NET and calling
oApp.LoadFromSQLServer, but what about VB Script?

For SQL2K:
Set oPkg = CreateObject("DTS.Package2")
oPkg.LoadFromSQLServer SQLServerName, ,
,DTSSQLStgFlag_UseTrustedConnection,,,,PackageName
oPkg.Execute()

My task: I am loading file sets from several locations and need to run
different SPs based on the load success or failure. I previously used VBS for
FSO date comparisons and to copy required file sets to a load location, and
then running a package to load them. The VB Script was called using
xp_cmdshell from within a cursor loop in a SP. Any better ssis suggestions?


Reply With Quote
  #2  
Old   
Flemo
 
Posts: n/a

Default RE: How to execute ssis package from .vbs? - 12-20-2006 , 07:29 PM






Here's how I ended up getting around it...

Set WSHShell = WScript.CreateObject("WScript.Shell")

intReturn = WshShell.Run("dtexec /sq pkgOne /ser productionServer",
[intWindowStype], [bWaitOnReturn])

Set WSHShell = Nothing

"Flemo" wrote:

Quote:
I am upgrading to SQL 2005. I have a VB script that calls a DTS package
(shown below). Is there a way for a VB script to call a SSIS package? I have
seen posts that mention adding a reference to
Microsoft.SqlServer.ManagedDTS.dll in VB.NET and calling
oApp.LoadFromSQLServer, but what about VB Script?

For SQL2K:
Set oPkg = CreateObject("DTS.Package2")
oPkg.LoadFromSQLServer SQLServerName, ,
,DTSSQLStgFlag_UseTrustedConnection,,,,PackageName
oPkg.Execute()

My task: I am loading file sets from several locations and need to run
different SPs based on the load success or failure. I previously used VBS for
FSO date comparisons and to copy required file sets to a load location, and
then running a package to load them. The VB Script was called using
xp_cmdshell from within a cursor loop in a SP. Any better ssis suggestions?


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.