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

Commit eb02516

Browse files
authored
Merge pull request #7720 from pmasl/patch-307
Update error-severity-transact-sql.md
2 parents 28b7f81 + 5aa0f68 commit eb02516

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

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

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ When called in a CATCH block where an error occurs, `ERROR_SEVERITY` returns the
5656

5757
### A. Using ERROR_SEVERITY in a CATCH block
5858
This example shows a stored procedure that generates a divide-by-zero error. `ERROR_SEVERITY` returns the severity value of that error.
59-
```
60-
59+
```sql
6160
BEGIN TRY
6261
-- Generate a divide-by-zero error.
6362
SELECT 1/0;
@@ -66,7 +65,9 @@ BEGIN CATCH
6665
SELECT ERROR_SEVERITY() AS ErrorSeverity;
6766
END CATCH;
6867
GO
69-
68+
```
69+
[!INCLUDE[ssResult](../../includes/ssresult-md.md)]
70+
```
7071
-----------
7172
7273
(0 row(s) affected)
@@ -82,8 +83,7 @@ ErrorSeverity
8283
### B. Using ERROR_SEVERITY in a CATCH block with other error-handling tools
8384
This example shows a `SELECT` statement that generates a divide by zero error. The stored procedure returns information about the error.
8485

85-
```
86-
86+
```sql
8787
BEGIN TRY
8888
-- Generate a divide-by-zero error.
8989
SELECT 1/0;
@@ -98,7 +98,9 @@ BEGIN CATCH
9898
ERROR_MESSAGE() AS ErrorMessage;
9999
END CATCH;
100100
GO
101-
101+
```
102+
[!INCLUDE[ssResult](../../includes/ssresult-md.md)]
103+
```
102104
-----------
103105
104106
(0 row(s) affected)
@@ -121,6 +123,7 @@ ErrorNumber ErrorSeverity ErrorState ErrorProcedure ErrorLine ErrorMessage
121123
[ERROR_STATE (Transact-SQL)](../../t-sql/functions/error-state-transact-sql.md)
122124
[RAISERROR (Transact-SQL)](../../t-sql/language-elements/raiserror-transact-sql.md)
123125
[@@ERROR (Transact-SQL)](../../t-sql/functions/error-transact-sql.md)
126+
[Errors and Events Reference (Database Engine)](../../relational-databases/errors-events/errors-and-events-reference-database-engine.md)
124127

125-
128+
126129

0 commit comments

Comments
 (0)