July 2015
Intermediate to advanced
972 pages
21h 39m
English
CHAPTER 21
![]()
Error Handling
In this chapter you’ll learn several error handling methods in T-SQL including structured error handling.
21-1. Handling Batch Errors
Problem
You have a script containing numerous Data Definition Language (DDL) and Data Manipulation Language (DML) statements that completely fail to run. You need to ensure that if part of the script fails due to an error the remaining script will complete, if there are no other errors.
Solution
A single script can contain multiple statements, and if run as a single batch the entire script will fail. When using SSMS or SQLCMD, batches can be separated with the GO command, ...
Read now
Unlock full access