Start SSIS package from a SQL Agent job

  • I have a SQL job that kicks off to populate some tables with test data. I also have an SSIS package that copies the data to another development SQL server called ScrapAllData_RePopulate.

    Within the SQL Agent job I want the final step to kick off my SSIS package. Can someone give an an example of how to do that?

    Thanks

  • add a new job step. In the Type dropdown, select sql server integration services package. then you need to fill in the appropriate tabs. what you will fill in may vary greatly, so I can't really go into what you will need in there, but hopefully this gets you on your way.

  • You could also call the SSIS package directly too if you wanted

    DECLARE @sqlCmd VARCHAR(1250) -- call to ssis package

    ,@returnCode INT -- returncode from package execution

    ,@ssisPath VARCHAR(1250)- location of ssis package

    SET @ssisPath = '\\server\ssis\mySSISPackage.dtsx'

    SELECT @sqlCmd = 'DTEXEC /F "' + @ssisPath + '"'

    -- call ssis package and return result

    EXEC @returnCode=Master..xp_cmdshell @sqlCmd

    SELECT @returnCode AS '@returnCode'

  • Enabling xp_cmdshell just to execute the SSIS package? You already have the Integration Services Package step type in the agent job configuration. If you decide to call it from CMD anyway then you have "CMDExec" step type availabe in the job configuration.


    Sujeet Singh

Viewing 4 posts - 1 through 3 (of 3 total)

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