sql事务

ALTER PROCEDURE [dbo].[sp_DeleteDraftForm]

@draftId int

AS

    Begin

        begin tran t

        delete from a where ID=@draftId

        delete from b where DRAFT_ID=@draftId 

        if  @@error<>0

            rollback tran t

        else

            commit tran t

    End

 

你可能感兴趣的:(sql)