Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Execute SSIS package stored in Database - From Stored Procedure Expand / Collapse
Posted Thursday, May 28, 2009 1:14 PM


Group: General Forum Members
Last Login: Monday, October 17, 2016 6:30 AM
Points: 435, Visits: 76
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 '/'.
Post #725376
Posted Thursday, May 28, 2009 7:50 PM



Group: General Forum Members
Last Login: Today @ 2:49 PM
Points: 7,948, Visits: 19,043
For a start, try using single quotes around your literals ...

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

Create procedure [dbo].[s_ExecutePackage]
@FilePath varchar(1000) ,
@Filename varchar(128)
Declare @cmd varchar(1000)
select @cmd = 'dtexec /F "' + @FilePath + @Filename + '"'
exec master..xp_cmdshell @cmd

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

Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.

Just when you think your code is idiot-proof, the world invents a better idiot.
Post #725557
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse