Tag: SQL Exception Handling

There are cases when you see error messages relayed from inside the try-block. Some are intuitive and some are not. Compile Errors – These errors can simply not be caught. This is true for any programming language. When compilation of a program generates an error it can not be caught by the enclosing try-block. As…

Each error in the server has two parts – an error message that describes the error that happened in the server and an error action that determines the effect of the error on the statement, level, batch, transaction, connection and/or server. Server has instances of different combinations of errors and error messages. The major ones…

Tsql try-catch was added to improve server side error handling in sql server 2005. This feature should have been part of early T-Sql. Better late than never. In absence of tsql try-catch, server-side error handling was done using @@error. This had necessitated statement abort as the error policy. Under this policy the execution of a…