Stored procedure to execute a dtsx (SSIS) package

Posted: February 19, 2010 in SQL, SSIS

CREATE PROCEDURE [dbo].[T_Town Snapshot_Call]
AS
BEGIN
DECLARE @FilePath   varchar(1000)
DECLARE @Filename   varchar(128)
DECLARE @path varchar(2000)
DECLARE @cmd varchar(7000)

SET @FilePath=’C:\Inetpub\wwwroot\CRITown\CRITownDatabase\’
SET @Filename=’TownSnapshotPackage.dtsx’
SET @path='”C:/Program Files (x86)/Microsoft SQL Server/90/DTS/Binn/”‘

SELECT @cmd = ‘C:\PROGRA~2\MICROS~2\90\DTS\BINN\DTExec.exe /F “‘ + @FilePath + @Filename + ‘” /CHECKPOINTING OFF’

EXEC master..xp_cmdshell  @cmd
END

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s