Wednesday, February 15, 2012

Execute DTS from .sql batch

1)
How do i execute myDTS.dts file which is located on c:\...\myDTS.dts from
sql batch ?
2)
How do i execute DTS job "myDTS" which is saved on sql server ? from sql
batch ?
1) You can run it via xp_cmdshell using the dtsrun command line tool. See
BOL for details e.g
exec xp_cmdshell 'dtsrun /Ffilename /Npackage_name'
2) If you mean a SQL job then you can call sp_start_job. See BOL for
details.
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Mikus" <Mikus@.discussions.microsoft.com> wrote in message
news:F2732A01-18FE-4326-BAF7-286DE1110DC1@.microsoft.com...
> 1)
> How do i execute myDTS.dts file which is located on c:\...\myDTS.dts from
> sql batch ?
> 2)
> How do i execute DTS job "myDTS" which is saved on sql server ? from sql
> batch ?

No comments:

Post a Comment