Execute SSIS package stored in Database - From Stored Procedure

  • I am trying to execute a SSIS package that is stored in a SQL Server 2005 database - want to execute from a stored procedure in same database. What commands/operations are necessary.

    I tried:

    dtexec /SQL "\PKG_Name" /Server_Name "." /MAXCONCURRENT " -1 " /CHECKPOINTING OFF /REPORTING E /De "Password"

    Msg 102, Level 15, State 1, Line 1

    Incorrect syntax near '/'.

  • For a start, try using single quotes around your literals ...

    --edit:

    You may first want to create an sp to help. Something like:

    Create procedure [dbo].[s_ExecutePackage]

    @FilePath varchar(1000) ,

    @Filename varchar(128)

    as

    Declare @cmd varchar(1000)

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

    exec master..xp_cmdshell @cmd

    go

    This will help you execute the package from within your sp, once you have enabled use of xp_cmdshell, of course.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

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

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