Home Forums SQL Server 2005 SQL Server 2005 General Discussion Ideas about Error 266 "Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRANSACTION statement is missing. Previous count = 1, current count = 0." RE: Ideas about Error 266 "Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRANSACTION statement is missing. Previous count = 1, current count = 0."

  • something like

    if (xact_state() = 0) begin

    begin tran

    set @towner = 1

    end--if

    if (xact_state() <> 0 and @towner = 1) begin

    rollback tran

    end--if