I have the following SP :
USE [gestionriesgo]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER proc [dbo].[SpCambioPass]
@userLogin varchar(30),
@pass varchar(80),
@salt varchar(80)
as
begin
update userRegister
set pass = @pass, salt = @salt
where userLogin = @userLogin
end
and if it affects more than one row, it returns a variable that says exitoso
otherwise it says Error al actualizar
, but I have no idea how to do it
After
UPDATE
you can get the affected rows in the operation using the system function@@ROWCOUNT
. If this is greater than zero you return "successful", otherwise "error".I put the relevant part of the code