Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Exec package by using stored procedure

Author  Topic 

Anand.A
Posting Yak Master

109 Posts

Posted - 2012-02-16 : 06:15:54


hi

i create a tsql to run ssis package

like this:
Declare @FilePath varchar(2000)

Declare @Filename varchar(1000)

Declare @cmd varchar(2000)

DECLARE @ package_name varchar(200)

SELECT @ package_name = package_NAME FROM table_detail
WHERE PROC_START_DATE = getdate()

set @FilePath = 'C:\Documents and Settings\My Documents\Visual Studio 2008\Projects\test\test\bin\'

set @Filename = @ package_name

select @cmd = 'DTExec /F "' + @FilePath + @Filename + '"'

print @cmd

exec master..xp_cmdshell @cmd

so in that select package_name statement will give, which package want to run today's date..
so now my select statement will return 2 package_names
my tsql only run only package.. how to run both 2 packages by using tsql


anand

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-02-16 : 15:43:45
you need to have a cursor or while loop for that.
I would have added a master package in SSIS to read details from the table and executed child packages from that rather than using DTExec in T-sql

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -