Tech Off Thread

3 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Getting Output Value From Stored Proc which called from other SP

Back to Forum: Tech Off
  • User profile image
    JuNK64

    CREATE PROCEDURE [dbo].[JK_SP]
     (
       @ID int,
       @BLABLA int OUTPUT
    )

    BEGIN
       IF @ASD = 666 
       SET @BLABLA = 444
    END

    CREATE PROCEDURE [dbo].[JK_SP2]
    (
    @ASD int
    )
    BEGIN
      SET @ASD = 666
       EXEC JK_SP @ASD
    END



    BY EXECUTING JK_SP IT GIVES ME AN OUTPUT VALUE BUT I CANT GET IT

    HOW CAN I GET OUTPUT VALUE FROM FIRST SP FROM SP2
    ??????

  • User profile image
    Matthew van Eerde

    Change [JK_SP2] as follows:

    CREATE PROCEDURE [dbo].[JK_SP2]
    (
    @ASD int
    )
    AS
    BEGIN

        DECLARE @PulledFromJKSP int

        SET @ASD = 666

        EXEC JK_SP
            @ASD,
            @PulledFromJKSP OUT

        -- do stuff with @PulledFromJKSP here
    END

  • User profile image
    JuNK64

    Thanks A Lot Thats exactly what i want ....

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.