BEGIN TRY    
        BEGIN TRAN
        IF(@HandleType=1)
        BEGIN
            UPDATE table SET ...
        END
        ELSE
        BEGIN
            UPDATE table SET ...
            UPDATE table SET ...
        END
        COMMIT TRAN
   END TRY
   BEGIN CATCH
    ROLLBACK TRAN
     RAISERROR(N'更新失败',16,1)
   END CATCH    

 

posted on 2016-03-12 11:52  vinsonLu  阅读(566)  评论(0编辑  收藏  举报