Y
yuzhizhi
Unregistered / Unconfirmed
GUEST, unregistred user!
create procedure Cancel_shoptoPC @ID char(10), @Shop_ID char(6), @PC_ID char(6)ASbegin begin transaction delete From ShopuseForPC where id=@ID if @@rowcount=0 begin raiserror('error',16,1) rollback transaction return 99 end ELSE BEGIN Update device_set set PC_use='' where ID=@PC_ID if @@rowcount=0 Update Shop_Base set shop_use='' where ID=@Shop_ID //这句不被执行,我的需求是当device_set表中没有更新记录,最后要把Shop_Base表中Shop_use状态改变。 commit transaction return 1 END end现在不知道错在哪?if @@rowcount=0难道这句有问题?