基特的错误代码

来源:互联网 发布:网页美工是怎样的 编辑:程序博客网 时间:2024/04/27 17:49

Select ysos_tid INto #a
From yq_store_out_sub
Where yso_tid not in
(
Select Yso_tid From yq_store_out
)

Go

Begin Tran
UPDATE yq_store_stock SET yss_status = '入库',yss_outid = Null
   WHERE yss_outid in (select ysos_tid From #a)
IF @@Error <> 0
Begin
 Rollback
 Raiserror('更新错误',11,1)
 Return
End

Delete yq_store_out_sub Where ysos_tid in (select ysos_tid From #a)
IF @@Error <> 0
Begin
 Rollback
 Raiserror('删除错误',11,1)
 Return
End
Commit
Go