exec package by using stored procedure

  • 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

  • Look into using a while loop or a cursor. I believe that will provide you what you need.

    David

    @SQLTentmaker

    “He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply