Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRANSACTION statement is missing - SQL server 2005

前端 未结 4 992
不思量自难忘°
不思量自难忘° 2021-01-11 12:35

I am getting the error from the application as following with SQL server 2005

\"Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK

4条回答
  •  佛祖请我去吃肉
    2021-01-11 12:58

    that usually means that you had nested transactions and there was a ROLLBACK. you don't really provide any information about the code running, stored procedures, dynamic SQL, etc. So this is just a guess, but I would do a search for "ROLLBACK" and add PRINTs or INSERTs INTO YourErrorLogTable after each one, make sure that the content is unique enough to determine what ROLLBACK was hit. Another thing you can try is to add some TRY - CATCH blocks where you include PRINTs or INTO YourErrorLogTable in the CATCH. If you provide more details about the code being called (nested procedures, are you using try-catch blocks, dynamic sql, linq, etc.), I could give you more specific advise on how to find the problem.

提交回复
热议问题