SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Site Related Forums
 Article Discussion
 Article: Handling Errors in Stored Procedures
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

AskSQLTeam
Ask SQLTeam Question

USA
0 Posts

Posted - 02/03/2001 :  10:59:51  Show Profile  Visit AskSQLTeam's Homepage  Reply with Quote
The following article introduces the basics of handling errors in stored procedures. If you are not familiar with the difference between fatal and non-fatal errors, the system function @@ERROR, or how to add a custom error with the system stored procedure sp_addmessage, you should find it interesting.

Article Link.

Anonymous
Starting Member

0 Posts

Posted - 02/15/2001 :  09:49:00  Show Profile  Reply with Quote
Handling Errors in Stored Procedures

Good article, but I would like to have seen a bit more depth. Also:

1. You state that with fatal errors, there is no code you can implement that will allow you to handle them gracefully. This is true, but if you code the Stored Proceedure to use transactions, then the transaction will roll back automatically on fatal error, no? Also, you can configure the Agent to take action on specific (fatal) errors.

2. I would love to have seen a better description of @@RAISEERROR parameters. What is the STATE parameter for, and how can it be used? The NOWAIT option is confusing. If an error is fatal, then the client is notified immmediately, no? Would NOWAIT cause the client to be notified immediately of nonfatal errors, while the Stored Proceedure continues to run?

3. I am hoping you could document a centralised error handling system that takes specific actions depending on the error type. (I have developed my own, but it could be better.) Finally, I can't wait to read your next ADO article.

Stephen Barash

Go to Top of Page

Anonymous
Starting Member

0 Posts

Posted - 03/10/2001 :  13:21:14  Show Profile  Reply with Quote
Handling Errors in Stored Procedures

Think you should at least mention transaction control, triggers, @@error + @@rowcount for updates in this.

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000