--如果能找到记录,说明还可以上传
if exists(select 1
from tb
where amount+1<aceptamount and data<'2014.03.31' and status ="sleep"
and sn = @sn
)
update tb
set amount = amount+1
where sn = @sn
------解决方案-------------------- update tb
set amount = amount+1
where amount+1<aceptamount and data<'2014.03.31' and status ="sleep"
and sn = @sn
SELECT @@ROWCOUNT ------解决方案--------------------
--如果能找到记录,说明还可以上传
if exists(select 1
from tb
where amount+1<aceptamount and data<'2014.03.31' and status ="sleep"
and sn = @sn
)
update tb
set amount = amount+1
where sn = @sn
可是sn要从上传的文件中取,这样写可以吗?
sn是上传文件中的,那得把sn提取出来,传入到存储过程中
我不知道该怎么提取啊,求代码
CREATE PROC test(@sn nvarchar(20))
AS
BEGIN
放上面代码
END