help closing an open batch

Hi all,

Long story short - can one of you smart folks provide me the sql code to close a held controlled batch in our TEST environment? We have a live to test copy that is failing, apparently because of this open batch, and I can't find it to fix it.

Thanks, 

Lesley

Parents
  • Try this.


    DECLARE @Batch_no INT =

    --insert batch number here

    ;

    BEGIN TRANSACTION A

    UPDATE T_BATCH

    SET T_BATCH.status = 'C'

    WHRER T_BATCH.batch_no = @Batch_no

    ;

    /*

    If OK, should only show 1 row effected

    COMMIT TRANSACTION A;

    If NOT ok,

    ROLLBACK TRANSACTION A;

    */

    Neil Cole | Customer Service Specialist Principal
    neil.cole@state.mn.us
    o: 952.431.9217 | MNZOO.ORG
    13000 Zoo Boulevard Apple Valley MN 55124
Reply
  • Try this.


    DECLARE @Batch_no INT =

    --insert batch number here

    ;

    BEGIN TRANSACTION A

    UPDATE T_BATCH

    SET T_BATCH.status = 'C'

    WHRER T_BATCH.batch_no = @Batch_no

    ;

    /*

    If OK, should only show 1 row effected

    COMMIT TRANSACTION A;

    If NOT ok,

    ROLLBACK TRANSACTION A;

    */

    Neil Cole | Customer Service Specialist Principal
    neil.cole@state.mn.us
    o: 952.431.9217 | MNZOO.ORG
    13000 Zoo Boulevard Apple Valley MN 55124
Children
No Data