7> BEGIN TRY
8> SELECT CONVERT(int, 'ABC') AS ConvertException
9> END TRY
10> BEGIN CATCH
11> IF ERROR_NUMBER() = 123
12> SELECT 'Error 123'
13> ELSE
14> SELECT ERROR_NUMBER() AS ErrorNumber
15> END CATCH
16> GO
ConvertException
----------------
(0 rows affected)
ErrorNumber
-----------
245
(1 rows affected)
26.7.ERROR_NUMBER |
| 26.7.1. | ERROR_NUMBER functions |