@@ERROR and @@ROWCOUNT only hold the value for the immediately preceding statement, so immediately after the statement you want to check you need to do:SELECT @MyErrNo = @@ERROR, @MyRowCount = @@ROWCOUNT --Note: Single SELECT statement!!and then do:IF (@MyRowCount = 1 ) BEGINSET @err = 'Password Change is a Success!' SELECT @err as lblerrorRETURNENDIF (@MyRowCount = 0 ) BEGINSET @err = 'Unable to change password! Make sure that you have Supplied the correct information!' SELECT @err as lblerrorRETURNEND
is there a good reason why you are doing:SET @err = 'Unable to change password! Make sure that you have Supplied the correct information!' SELECT @err as lblerror
instead of:SELECT 'Unable to change password! Make sure that you have Supplied the correct information!' AS lblerror
Kristen