Stored procedure and SSIS interaction

I have stored procedures that extract data from SQL table.. In these procedures we have various conditions and for some conditions if they are met we have a GOTO which points to an Error and Prints the custom error..
So according to the stored procedure that is an error and it prints it out.

here is what it looks like
our code begins...
 here is our code.....
then half  way thru the code this is part of the code...suppose this condition occurs then goto ERROR2
IF (@LowDate >= @HighDate)
            goto ERROR2

more code follows.....
at the end of the code these are the various error values which get pointed at..

      PRINT 'Procedure ERROR : Since ManualOverride, Please Enter Both Date Parameters'
      RETURN 10
      PRINT 'Procedure ERROR : Please ensure that the Low Date is earlier than the High Date'
      RETURN 11

      PRINT 'Procedure ERROR : High Date cannot be null'
      RETURN 12
      PRINT 'Procedure ERROR : Low Date MUST be null if doing a regular run'
      RETURN 13

 In SSIS i am calling these procedures with the Execute SQL task,

So my question is now since some condition occurs and then in stored procedure it will GO TO and ERROR and print that Error, thats something like an error and should not happen.. so would this be still executed by SSIS (considering it as a succesful run of stored procedure )and the package continues to run or does SSIS throw an error too when this GO TO ERROR occurs in stored procedure..
Who is Participating?
Reza RadConnect With a Mentor Consultant, TrainerCommented:
Yes, RaiseError will led to errors, but be careful about severity in raiserror.
severity from0 to 10 will not led error, just led messages,
severity from 21 to above will led fatal errors

for your case it's better to use severity between11 to 19 , for example 11 is good one.
Reza RadConsultant, TrainerCommented:
these error lables is not sql server errors, so execute sql task will not find them as error.
if you want to do better error handling it's better to use RAISERROR command instead of print a message as error.

esotericmeeAuthor Commented:
So having RaiseErrors in my stored procedure for occurrences of these events will consider them as errors?

and  upon finding these errors in execution of these procedure from Execute SQL task,  the SSIS package will then fail?

Thanks for your help
esotericmeeAuthor Commented:
That just worked
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.