Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Raise error and Begin try Expand / Collapse
Author
Message
Posted Monday, March 31, 2014 9:13 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, July 25, 2014 9:34 AM
Points: 389, Visits: 959
If my stored procedure throws exception, I need to catch the error. I used Begin try and logged the error.But what happens is the procedure ends with success. Can we make it to fail when there is an exception?
Post #1556528
Posted Monday, March 31, 2014 9:22 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 3:17 AM
Points: 5,233, Visits: 9,467
Use RAISERROR in your CATCH block.

John
Post #1556535
Posted Monday, March 31, 2014 9:38 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, July 25, 2014 9:34 AM
Points: 389, Visits: 959
great. I gave error in begin try block and catched it in catch block. It made it fail. Thanks

In My Log table, the ErrorProcedure is not being captured when there is logical error or when the query fails. When that column would be filled?
Post #1556552
Posted Monday, March 31, 2014 9:40 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 3:17 AM
Points: 5,233, Visits: 9,467
I'm afraid I don't know what you mean. Please post your code.

John
Post #1556553
Posted Monday, March 31, 2014 9:44 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, July 25, 2014 9:34 AM
Points: 389, Visits: 959
I am using the ErrorLog table given in MSDN. I will check the documentation first.
Post #1556557
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse