CREATE PROCEDURE [dbo].[Code]
@intEpmName NUMERIC,
@strFailedEMPID VARCHAR(1000) output
AS
DECLARE
@FailedCodes VARCHAR(1000)
BEGIN
----
my logic where i need return the value
SET @strFailedEMPID = @FailedCodes
-----
END
In the stored procedure above, I can send the value as "0" to @strFailedEMPID then to my procedure. However, when I return the value from my procedure, then to the same variable @strFailedEMPID I am sending the value as such:
lsqlParam = new SqlParameter("@strFailedEMPID ", SqlDbType.VarChar);
lsqlParam.Value = "0";
lsqlParam.Direction = ParameterDirection.ReturnValue;
lsqlCmd.Parameters.Add(lsqlParam);
Can anyone help with the correct syntax to get the return value from the procedure?