Friday, May 30, 2014

Update a single row with transaction

BEGIN TRAN
       UPDATE TORGPSM3PNT.K2Log.dbo.[_ProcInstData]
        SET Value='NSYS\afedorkomilrad'
        WHERE ProcInstID=195763 AND id=6

        IF @@TRANCOUNT=1
         COMMIT TRAN
ELSE
         ROLLBack TRAN

No comments:

Post a Comment