Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
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
Author
Message
Posted Thursday, May 28, 2009 1:14 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Tuesday, December 16, 2014 7:36 AM
Points: 364, Visits: 65
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


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 2:52 PM
Points: 5,317, Visits: 12,353
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.



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.

It is better to keep your mouth shut and appear stupid than to open it and remove all doubt. (Mark Twain)
Post #725557
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse