background preloader

SQL

Facebook Twitter

Fernando Amaral, PMP - Transact SQL e controle de Fluxo. W3Schools - SQL Tutorial. Handling Errors in Stored Procedures. By Garth Wells on 5 February 2001 | 2 Comments | Tags: Stored Procedures The following article introduces the basics of handling errors in stored procedures.

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. The examples presented here are specific to stored procedures as they are the desired method of interacting with a database. When an error is encountered within a stored procedure, the best you can do (assuming it’s a non-fatal error) is halt the sequential processing of the code and either branch to another code segment in the procedure or return processing to the calling application.

SQL Server UDF to pad a string. Hi Mr.

SQL Server UDF to pad a string

Jeff Moden, Thanks a lot for your response.