May 2006
Intermediate to advanced
536 pages
15h 13m
English
The support for exception handling in SQL Server 2000 had several limitations. It was nonstructured, it was awkward, and it wasn’t capable of trapping all errors.
The main tool it provided you for exception handling was the @@error function, which returned an integer representing the way the last statement terminated (with 0 indicating success and a non-zero error code indicating lack of success). You had to assign the value of @@error to your own local variable immediately after each suspect statement. Otherwise, you’d lose that value, as it would be overridden by the statement that followed the suspect one. Then you had to switch between the possible error codes and determine a course of action. You ...
Read now
Unlock full access