SQL Server Stored Procedure

More
8 years 2 months ago #17845 by bruce.gibbins
Hi, Our package needs to execute SQL Server Stored Procedure. This works well. However, I'd like to catch any errors and return back to AETL so that it can then decide what to do based on Success or Failure. I have forced an error in the Stored Proc using the RAISERROR T-SQL clause. When executing in the designer. The error is detected and displayed in the Message output. However, when executed from a Package or triggered from from a Directory Event Monitor the Execution log shows the SP being executed but no Error is logged and it completes successfully. The "Ignore SQL Execution Errors" check box IS NOT CHECKED.

Any Ideas?
Thanks

Please Log in or Create an account to join the conversation.

More
8 years 2 months ago - 8 years 2 months ago #17846 by Maria
Replied by Maria on topic SQL Server Stored Procedure
Hi Bruce

Have pressed save before running SQL script?

I tested everything here and it is working as expected.

Here is my stored procedure.
ALTER PROCEDURE [dbo].[update_Data]
AS
begin
--set nocount on
RAISERROR (15600,-1,-1, 'Terrible Error');
end

And some screnshots.


Attachments:
Last edit: 8 years 2 months ago by admin.

Please Log in or Create an account to join the conversation.

More
8 years 2 months ago #17849 by bruce.gibbins
Thanks Maria.

The stored Proc already existed and I put the forced RAISEERROR code in via SSMS. I will double check that it was inseed saved.

Will the contents of the error come back into AETL? The error code, text, severity, state, etc?

Cheers

Please Log in or Create an account to join the conversation.

More
8 years 2 months ago #17850 by Maria
Replied by Maria on topic SQL Server Stored Procedure
Will the contents of the error come back into AETL? The error code, text, severity, state, etc?

It is written in the log.

Please Log in or Create an account to join the conversation.

More
8 years 2 months ago #17851 by bruce.gibbins
Ok thanks. I am away from office but will check in nwxt hour or so. But do you look for specific error range? Perhaps I am passing back an error level not considered to be fatal.

Cheers

Please Log in or Create an account to join the conversation.

More
8 years 2 months ago #17852 by Maria
Replied by Maria on topic SQL Server Stored Procedure
Well, it is not us, it is SQL server. ;-)

"Severity levels from 20 through 25 are considered fatal. If a fatal severity level is encountered, the client connection is terminated after receiving the message, and the error is logged in the error and application logs."

Please Log in or Create an account to join the conversation.

Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Read more
Marketing
Set of techniques which have for object the commercial strategy and in particular the market study.
Google
Accept
Decline
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Google Analytics
Accept
Decline
Functional
Tools used to give you more features when navigating on the website, this can include social sharing.
Advertisement
If you accept, the ads on the page will be adapted to your preferences.
Google Ad
Accept
Decline
Save