Avatar of Blowfelt82
Blowfelt82
 asked on

SSIS: Fail 'Execute SQL Task' container based on returned result.

I have an SSIS package which has a 'Execute SQL Task' componenet. This task calls some SQL and returns 0 if everything is OK and 1 if an error has been found. This code is all working as expected. What I am looking for is a way to fail the component if the return code is > 0.

The 'Execute Process Task' has similar functionality where you can use the 'FailTaskIfReturnCodeIsNotSuccessValue' and 'SuccessValue' fields. I need the equivelent functionality for the 'Execute SQL Task'.
Microsoft SQL Server 2008Microsoft SQL Server

Avatar of undefined
Last Comment
Alpesh Patel

8/22/2022 - Mon
Daniel_PL

You can use RAISERROR depending on return value of your code in t-sql code inside task.
ASKER CERTIFIED SOLUTION
Alpesh Patel

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Blowfelt82

ASKER
Thanks for this suggestion, I agree that this may be the best way forward... I was hoping that the component could handle this itself rather than relying on a script component? Also why is there no SSIS section on EE?
Alpesh Patel

There is section for SSIS named SSIS_SSAS
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck