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

Commit 3535e7e

Browse files
authored
Update error-transact-sql.md
1 parent 9d93488 commit 3535e7e

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ monikerRange: ">=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-s
5252
### A. Using @@ERROR to detect a specific error
5353
The following example uses `@@ERROR` to check for a check constraint violation (error #547) in an `UPDATE` statement.
5454

55-
```
55+
```sql
5656
USE AdventureWorks2012;
5757
GO
5858
UPDATE HumanResources.EmployeePayHistory
@@ -66,7 +66,7 @@ GO
6666
### B. Using @@ERROR to conditionally exit a procedure
6767
The following example uses `IF...ELSE` statements to test `@@ERROR` after an `DELETE` statement in a stored procedure. The value of the `@@ERROR` variable determines the return code sent to the calling program, indicating success or failure of the procedure.
6868

69-
```
69+
```sql
7070
USE AdventureWorks2012;
7171
GO
7272
-- Drop the procedure if it already exists.
@@ -101,7 +101,7 @@ GO
101101
### C. Using @@ERROR with @@ROWCOUNT
102102
The following example uses `@@ERROR` with `@@ROWCOUNT` to validate the operation of an `UPDATE` statement. The value of `@@ERROR` is checked for any indication of an error, and `@@ROWCOUNT` is used to ensure that the update was successfully applied to a row in the table.
103103

104-
```
104+
```sql
105105
USE AdventureWorks2012;
106106
GO
107107
IF OBJECT_ID(N'Purchasing.usp_ChangePurchaseOrderHeader',N'P')IS NOT NULL
@@ -170,7 +170,7 @@ GO
170170
[ERROR_SEVERITY (Transact-SQL)](../../t-sql/functions/error-severity-transact-sql.md)
171171
[ERROR_STATE (Transact-SQL)](../../t-sql/functions/error-state-transact-sql.md)
172172
[@@ROWCOUNT (Transact-SQL)](../../t-sql/functions/rowcount-transact-sql.md)
173-
[sys.messages (Transact-SQL)](../../relational-databases/system-catalog-views/messages-for-errors-catalog-views-sys-messages.md)
174-
173+
[sys.messages (Transact-SQL)](../../relational-databases/system-catalog-views/messages-for-errors-catalog-views-sys-messages.md)
174+
[Errors and Events Reference (Database Engine)](../../relational-databases/errors-events/errors-and-events-reference-database-engine.md)
175175

176176

0 commit comments

Comments
 (0)