Thursday, 25 October 2012

how to return multiple values from stored procedure in sql server

ALTER PROCEDURE p3
    (
    @EID INT,
    @NAME VARCHAR(50) OUTPUT,
    @SAL MONEY OUTPUT
    )
AS
begin
select name,sal from emp where eid=@EID
end

EXECUTE
DECLARE @NAME VARCHAR(50),@SAL MONEY
EXEC P3 1,@NAME=@NAME OUTPUT,@SAL=@SAL 

No comments:

Post a Comment