Click or drag to resize

SA0138 : BEGIN TRANSACTION statement without ROLLBACK statement

The topic describes the SA0138 analysis rule.

Message

BEGIN TRANSACTION statement without ROLLBACK statement

Description

The rule checks T-SQL code for BEGIN TRANSACTION statement, which is not followed by a ROLLBACK statement.

While ROLLBACK statement is not required, it is necessary for good error handling practices.

Scope

The rule has a Batch scope and is applied only on the SQL script.

Parameters

Rule has no parameters.

Remarks

The rule does not need Analysis Context or SQL Connection.

Categories

Design Rules, New Rules

Additional Information
Example Test Script
SQL
1BEGIN TRANSACTION
2
3ROLLBACK
4
5BEGIN TRANSACTION

Analysis Results

 MessageLineColumn
1SA0138 : BEGIN TRANSACTION statement without ROLLBACK statement.50
See Also

Other Resources