帮忙看一下,这个存储过程那里有问题!
输入number(编号),amount(数量).查询原来表中的amount,用它来减去输入的amount得到一个
新的amount,然后修改表为新的amount.
CREATE PROCEDURE fetchupdatestore1
(
@number nvarchar(10),
@amount int
)
AS
select amount as num from table_store where number=@number
if Rowcount>1
update table_store
set
amount=num-@amount
where number=@number
go