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

前端 未结 4 991
不思量自难忘°
不思量自难忘° 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 13:01

    I don't think anything is missing. It's probably an inner stored procedure that gets called from inside a transaction (TRANCOUNT = 1), starts its own transaction (TRANCOUNT = 2) and then rolls it back. Well, it means to roll it back, but rollback affects all transactions and not only the innermost one, so the procedure screws up the execution flow.

    A way to find the place depends on available tools/skills. A better way is to use SQL Profiler that shows all commands executed by an application against the server. Find out the outermost stored procedure and go through its code looking for any other procedure calls.

提交回复
热议问题