CREATE PROCEDURE sp_person_changepwd
(
@id nvarchar(50),
@oldpwd nvarchar(50),
@newpwd nvarchar(50)
)
AS
if not exists(select * from person where id=@id and pwd=@oldpwd)
begin
return 0
end
else
begin
update person set pwd=@newpwd where id=@id
return 1
end