Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tsql:catching_multiple_errors [2015/04/24 21:43]
richard
tsql:catching_multiple_errors [2017/07/21 21:47] (current)
Line 1: Line 1:
 ====== Catching multiple errors ====== ====== Catching multiple errors ======
  
-The error values available as functions in the scope of CATCH block only return information about the **last** error raised, but sometimes (e.g. if a database restore fails because the disk is full) several errors are thrown. ​+The error values available as functions in the scope of CATCH block only return information about the //last// error raised, but sometimes (e.g. if a database restore fails because the disk is full) several errors are thrown. ​
  
 Extended events can be used to trap //all// errors emerging from a SQL statement. This query thanks to [[http://​dba.stackexchange.com/​questions/​53966/​sql-servers-backup-database-how-to-access-the-original-exception|TToni]]. Extended events can be used to trap //all// errors emerging from a SQL statement. This query thanks to [[http://​dba.stackexchange.com/​questions/​53966/​sql-servers-backup-database-how-to-access-the-original-exception|TToni]].