Hi all,
This enumeration has the following values (from help) ...
| Description | ||
|---|---|---|
| Input | The parameter is an input parameter. | |
| InputOutput | The parameter is capable of both input and output. | |
| Output | The parameter is an output parameter. | |
| ReturnValue | The parameter represents a return value from an operation such as a stored procedure, built-in function, or user-defined function. |

ParameterDirection Enumeration
christian bitter
Surfsune
Heres an exaple of a ReturnValue SP:
In ADO.net you would add a parameter @user_id with ReturnValue Enum
CREATE PROCEDURE usp_checkuser
@login varchar(50),
@pswd varchar(50),
@usr_id int
AS
SET @usr_id = (SELECT id FROM USRS
WHERE login=@login
AND pswd=@pswd)
RETURN @usr_id
GO
Now the same one using output parms, but I can use more output parms than return parms:In ADO.net you would add a parameter @user_id with Output Enum and
a parameter @lastlogin with Output Enum
CREATE PROCEDURE usp_checkuser
@login varchar(50),
@pswd varchar(50),
@usr_id int output,
@lastlogin smalldatetime output
AS
DECLARE @id int
DECLARE @laslogin smalldatetime
SELECT @id = id, @laslogin=lastlogin FROM USRS
WHERE login=@login
AND pswd=@pswd
SET @usr_id = @id
SET @lastlogin = @login
GO
Also RETURN can only return integer values.. while output can be varchar, date etc.