Msg 628 Level 16 State 0 Line 3 – SQLSERVERLEARNER https://sqlserverlearner.com LEARN SQL SERVER ONLINE Thu, 17 May 2012 10:59:12 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.2 Cannot issue SAVE TRANSACTION when there is no active transaction. https://sqlserverlearner.com/2012/05/17/cannot-issue-save-transaction-when-there-is-no-active-transaction/ https://sqlserverlearner.com/2012/05/17/cannot-issue-save-transaction-when-there-is-no-active-transaction/#respond Thu, 17 May 2012 10:59:12 +0000 https://sqlserverlearner.azurewebsites.net/2012/05/17/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.

]]>
https://sqlserverlearner.com/2012/05/17/cannot-issue-save-transaction-when-there-is-no-active-transaction/feed/ 0