create proc ProcdeleteMaterial
@imageid int
as
begin tran
delete from materialdetail where detailAutoid=@imageid;
IF @@ERROR!=0 --THEN 这里有错 SQL if 不需要then 后面跟begin end 即可,如果是一句的话begin end也可以省略
BEGIN
RETURN
END
delete from materialMain where imageid=@imageid
IF @@error!=0 or @@rowcount=0 --THEN 这里也有错
begin
rollback tran
print 'error'
return
end
commit tran
RETURN
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货