@@ -57,8 +57,7 @@ In nested `CATCH` blocks, `ERROR_MESSAGE` returns the error message specific to
5757### A. Using ERROR_MESSAGE in a CATCH block
5858This example shows a ` SELECT ` statement that generates a divide-by-zero error. The ` CATCH ` block returns the error message.
5959
60- ```
61-
60+ ``` sql
6261BEGIN TRY
6362 -- Generate a divide-by-zero error.
6463 SELECT 1 / 0 ;
@@ -67,7 +66,9 @@ BEGIN CATCH
6766 SELECT ERROR_MESSAGE() AS ErrorMessage;
6867END CATCH;
6968GO
70-
69+ ```
70+ [ !INCLUDE[ ssResult] ( ../../includes/ssresult-md.md )]
71+ ```
7172-----------
7273
7374(0 row(s) affected)
@@ -83,7 +84,7 @@ Divide by zero error encountered.
8384### B. Using ERROR_MESSAGE in a CATCH block with other error-handling tools
8485This example shows a ` SELECT ` statement that generates a divide-by-zero error. Along with the error message, the ` CATCH ` block returns information about that error.
8586
86- ```
87+ ``` sql
8788BEGIN TRY
8889 -- Generate a divide-by-zero error.
8990 SELECT 1 / 0 ;
@@ -98,7 +99,9 @@ BEGIN CATCH
9899 ,ERROR_MESSAGE() AS ErrorMessage;
99100END CATCH;
100101GO
101-
102+ ```
103+ [ !INCLUDE[ ssResult] ( ../../includes/ssresult-md.md )]
104+ ```
102105-----------
103106
104107(0 row(s) affected)
@@ -111,4 +114,17 @@ ErrorNumber ErrorSeverity ErrorState ErrorProcedure ErrorLine ErrorMessage
111114
112115```
113116
117+ ## See Also
118+ [ sys.messages ( ; Transact-SQL) ; ] ( ../../relational-databases/system-catalog-views/messages-for-errors-catalog-views-sys-messages.md )
119+ [ TRY...CATCH ( ; Transact-SQL) ; ] ( ../../t-sql/language-elements/try-catch-transact-sql.md )
120+ [ ERROR_LINE ( ; Transact-SQL) ; ] ( ../../t-sql/functions/error-line-transact-sql.md )
121+ [ ERROR_MESSAGE ( ; Transact-SQL) ; ] ( ../../t-sql/functions/error-message-transact-sql.md )
122+ [ ERROR_PROCEDURE ( ; Transact-SQL) ; ] ( ../../t-sql/functions/error-procedure-transact-sql.md )
123+ [ ERROR_SEVERITY ( ; Transact-SQL) ; ] ( ../../t-sql/functions/error-severity-transact-sql.md )
124+ [ ERROR_STATE ( ; Transact-SQL) ; ] ( ../../t-sql/functions/error-state-transact-sql.md )
125+ [ RAISERROR ( ; Transact-SQL) ; ] ( ../../t-sql/language-elements/raiserror-transact-sql.md )
126+ [ @@ERROR ( ; Transact-SQL) ; ] ( ../../t-sql/functions/error-transact-sql.md )
127+ [ Errors and Events Reference ( ; Database Engine) ; ] ( ../../relational-databases/errors-events/errors-and-events-reference-database-engine.md )
128+
129+
114130
0 commit comments