Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Execution of SSIS package in T-SQL to return just a record to indicate Success or Fail

$
0
0

Hi, I am executing a SSIS package in T-SQL via xp_cmdshell, I am doing it this way because my client wants it to be done. I am using SQL Server 2008 R2 environment.

CREATE PROCEDURE [dbo].[USP_ExecuteSSIS]  
    @SSISPath VARCHAR(500),  
    @Server VARCHAR(500),
    @SSISConfig VARCHAR(500),
    @TableName VARCHAR(500),
    @File VARCHAR(500)
AS
SET NOCOUNT ON
DECLARE
@Cmd VARCHAR(4000),
@ReturnCode INT,
@Msg VARCHAR(1000)
SELECT @Cmd = 'C:\"program files (x86)"\"Microsoft SQL Server"\100\DTS\Binn\DTEXEC.exe /FILE "' + @SSISPath + '\SSISPackage.dtsx" /CONFIGFILE "' + @SSISConfig + '" /MAXCONCURRENT 1 /CHECKPOINTING OFF  /REPORTING EWCDI'+ ' /SET \Package.Variables[User::DBServer].Properties[Value];' + @Server+ ' /SET \Package.Variables[User::TextFile].Properties[Value];' + @File+ ' /SET \Package.Variables[User::DBTable].Properties[Value];' + @TableName
EXEC @ReturnCode = xp_cmdshell @Cmd
IF @ReturnCode <> 0
BEGIN
   SELECT @Msg = 'SSIS package execution failed - ' + @SSISPath + 'Instance Name: ' + @Server + '.dbo.DBName'
END
RETURN @ReturnCode
GO

Well, when this stored procedure executes I just want it to return success or fail and suppress all the pipeline information. Could you please let me know if this could beachieved.

Thanks in advance....................


Ione



Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>