Is there any possibility to get 2 outputs parameters from the stored procedure?

  • Hai,

    Here i have a situation to get two return values from the stored procedure.

    How can i achieve it?

     

     

     

  • GO

    CREATE PROCEDURE dbo.DEMO @a as int, @b-2 as int out, @C as int output

    AS

    SET NOCOUNT ON

    SET @b-2 = @a + 1

    SET @C = @a * 5

    Select @a as a, @b-2 as b, @C as c

    RETURN @a

    SET NOCOUNT OFF

    GO

    Declare @out1 as int

    Declare @out2 as int

    Declare @Return as int

    Select @out1, @out2, @Return

    --null, null, null

    EXEC @Return = dbo.demo 2, @out1 output, @out2 output

    --2,3,10

    Select @out1, @out2, @Return

    --3, 10, 2

    DROP PROCEDURE DEMO

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply