Output of SP1 stored procedure in #Temp TABLE OF SP2.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Question123
    New Member
    • Feb 2008
    • 41

    Output of SP1 stored procedure in #Temp TABLE OF SP2.

    Hello ..

    I want Output of SP1 stored procedure in #Temp TABLE OF SP2.

    Something like this .......

    CREATE SP2
    @iLoginId INT
    AS
    BEGIN
    SELECT *
    INTO #Temp
    FROM [SP1]

    SELECT TOP 20
    FROM #Temp

    END

    --Regards
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    If you create the temp table inside your stored proc, it will not be visible outside that stored proc.

    There might be other ways of doing it. What are you trying to do?

    -- CK

    Comment

    • Question123
      New Member
      • Feb 2008
      • 41

      #3
      Originally posted by ck9663
      If you create the temp table inside your stored proc, it will not be visible outside that stored proc.

      There might be other ways of doing it. What are you trying to do?

      -- CK
      Hello

      i am trying to SELECT TOP 10 recordes of output of SP1 from SP2.

      -- Regards

      Comment

      • ck9663
        Recognized Expert Specialist
        • Jun 2007
        • 2878

        #4
        Try using a table function.

        -- CK

        Comment

        • Question123
          New Member
          • Feb 2008
          • 41

          #5
          Originally posted by ck9663
          Try using a table function.

          -- CK
          Hello

          Thanks for the reply.

          With Table function problem is that i have to know table schema before creating table function.

          But i am executing any sp [SP1 is name of stored procedure passed to SP2] so i dont know table schema.

          so give me any idea..

          --Regards,

          Comment

          • ck9663
            Recognized Expert Specialist
            • Jun 2007
            • 2878

            #6
            Could you oist some sample data and what you're trying to accomplish?

            -- CK

            Comment

            Working...