the problem of @@TRANCOUNT--how to eliminate the no.266 error
Database
2
Posts
2
Posters
0
Views
1
Watching
-
the problem of @@TRANCOUNT--how to eliminate the no.266 error
-
the problem of @@TRANCOUNT--how to eliminate the no.266 error
Ensure that every use of
BEGIN TRAN
is matched with either aROLLBACK TRAN
or aCOMMIT TRAN
, regardless of whether an error occurs. In the case of a fatal error, SQL Server will roll back any transactions before it closes your connection. If you have implicit transactions enabled (throughSET IMPLICIT_TRANSACTIONS ON
) aBEGIN TRAN
happens automatically the first time you perform any data modification operation. You still have to commit or roll-back this implicit transaction explicitly. Stability. What an interesting concept. -- Chris Maunder