Advertisement

11.12.2007 at 08:03AM PST, ID: 22954756
[x]
Attachment Details

DTS Execute SQL Task - workflow always returns success - how to set?

Asked by lisfolks in MS SQL DTS

Tags: dts, sql, task, execute

I have the following code in a stored procedure called by a DTS Execute SQL Task:
-----------------------------------------------------
-- Error handler for Errors encountered
ErrorHandler:

SELECT @Severity = severity
FROM master..sysmessages where error = @ErrorNumber

EXEC CreateError @ErrorID = @ErrorID OUTPUT,
            @ErrorDate = @ErrorDate,
            @LogonUser = @LogonUser,
            @Source = @ProcName,
            @CurrentTask = @CurrentTask,
            @ErrorNumber = @ErrorNumber,
            @ErrorMessage = @ErrorMessage,
            @TargetSite = NULL,
            @StackTrace = NULL,
            @Severity = @Severity,
            @BatchID = @BatchID

IF @ErrorNumber = 50000
      RAISERROR(@ErrorMessage, @Severity, 1)
RETURN (-1)
-----------------------------------------------------

An error is occurring, so the SP should be returning a -1, yet the task workflow always returns success regardless of whether it succeeds or fails.  What do I need to set in the task to make it recognize that the SP failed???

Note:  I have Execute SQL Tasks in other packages using SPs with the exact same code as above that work perfectly.  We use a template to create our packages, so they all work basically the same way.  I can't see any difference between this one that always succeeds and the ones that succeed or fail appropriately.Start Free Trial
 
 
[+][-]11.12.2007 at 11:41AM PST, ID: 20266583

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.12.2007 at 11:59AM PST, ID: 20266751

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.12.2007 at 05:19PM PST, ID: 20268945

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.13.2007 at 06:40AM PST, ID: 20271735

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.13.2007 at 10:00AM PST, ID: 20273524

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.16.2007 at 12:31PM PST, ID: 20301255

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: MS SQL DTS
Tags: dts, sql, task, execute
Sign Up Now!
Solution Provided By: lisfolks
Participating Experts: 2
Solution Grade: B
 
 
[+][-]12.23.2007 at 07:59AM PST, ID: 20521858

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.23.2007 at 08:30AM PST, ID: 20521925

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628