Cannot issue SAVE TRANSACTION when there is no active transaction.

Error Message:

Msg 628, Level 16, State 0, Line 1
Cannot issue SAVE TRANSACTION when there is no active transaction.

Why This Error?
– This error occurs when SAVE TRANSACTION/TRAN command is issued prior to issuing BEGIN TRANSACTION Command.
– The transaction could be commited/Rollbacked before issuing SAVE TRANSACTION command

Examples:
[sql]
SAVE TRAN Tran1
[/sql]
OR
[sql]
BEGIN TRAN
ROLLBACK TRAN
SAVE TRAN Tran1
[/sql]

Fix/Resolution:

Check for BEGIN TRAN command before SAVE TRAN command.
Check if the tran is commited/rollbacked before SAVE Tran Command.
If the transaction needs to be saved then make sure that the SAVE TRAN command is issued after the BEGIN TRAN command and before the COMMIT/ROLLBACK Tran command.

Leave a Reply

Your email address will not be published. Required fields are marked *