Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit d4ca1f0

Browse files
authored
Merge pull request #7717 from pmasl/patch-304
Update error-number-transact-sql.md
2 parents 9bcbb30 + 7b6a479 commit d4ca1f0

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

docs/t-sql/functions/error-number-transact-sql.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ In a nested `CATCH` block, `ERROR_NUMBER` returns the error number specific to t
5757
### A. Using ERROR_NUMBER in a CATCH block
5858
This example shows a `SELECT` statement that generates a divide-by-zero error. The `CATCH` block returns the error number.
5959

60-
```
60+
```sql
6161
BEGIN TRY
6262
-- Generate a divide-by-zero error.
6363
SELECT 1/0;
@@ -66,7 +66,9 @@ BEGIN CATCH
6666
SELECT ERROR_NUMBER() AS ErrorNumber;
6767
END CATCH;
6868
GO
69-
69+
```
70+
[!INCLUDE[ssResult](../../includes/ssresult-md.md)]
71+
```
7072
-----------
7173
7274
(0 row(s) affected)
@@ -82,8 +84,7 @@ ErrorNumber
8284
### B. Using ERROR_NUMBER in a CATCH block with other error-handling tools
8385
This example shows a `SELECT` statement that generates a divide-by-zero error. Along with the error number, the `CATCH` block returns information about that error.
8486

85-
```
86-
87+
```sql
8788
BEGIN TRY
8889
-- Generate a divide-by-zero error.
8990
SELECT 1/0;
@@ -98,7 +99,9 @@ BEGIN CATCH
9899
ERROR_MESSAGE() AS ErrorMessage;
99100
END CATCH;
100101
GO
101-
102+
```
103+
[!INCLUDE[ssResult](../../includes/ssresult-md.md)]
104+
```
102105
-----------
103106
104107
(0 row(s) affected)
@@ -120,7 +123,8 @@ ErrorNumber ErrorSeverity ErrorState ErrorProcedure ErrorLine ErrorMessage
120123
[ERROR_SEVERITY (Transact-SQL)](../../t-sql/functions/error-severity-transact-sql.md)
121124
[ERROR_STATE (Transact-SQL)](../../t-sql/functions/error-state-transact-sql.md)
122125
[RAISERROR (Transact-SQL)](../../t-sql/language-elements/raiserror-transact-sql.md)
123-
[@@ERROR (Transact-SQL)](../../t-sql/functions/error-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)
124128

125129

126130

0 commit comments

Comments
 (0)