create procedure colupdate (
@firstname varchar(200),
@status varchar(200)
)
as
begin
select Firstname,Lastname,status from tbl_Students
where Firstname=@Firstname
update tbl_Students
set status= @status
where @firstname=Firstname
end
我称之为:
execute colupdate 'Vikek','deactivate'
现在我得到"零行更新"。
我该如何更新?
答案 0 :(得分:0)
愿这个人帮你解决
create procedure colupdate (
@firstname varchar(200),
@status varchar(200)
)
as
begin
IF EXISTS(select Firstname,Lastname,status from tbl_Students where Firstname=@Firstname)
update tbl_Students set status= @status where Firstname=@Firstname Else
Print ' data not exist'
end