Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2003
    Posts
    10

    Unanswered: Obtaining data from an EXEC

    Hi all,

    I have a stored procedure which returns a recordset of data. What I want to do is execute this stored procedure in another stored procedure and insert the recordset returned into a temporary table.

    ie.

    Stored Procedure Test1 may perform the following action: -
    SELECT * FROM MyTable1

    Stored Procedure Test2 would do something like this: -

    EXEC Test1

    INSERT INTO #TempTable {The recordset returned from Test1}

    Any ideas how I would go about this?

    Cheers,

    Rob

  2. #2
    Join Date
    Feb 2002
    Location
    Houston, TX
    Posts
    809
    change sp Test2 to:

    insert into #TempTable
    execute Test1
    Paul Young
    (Knowledge is power! Get some!)

  3. #3
    Join Date
    Mar 2003
    Posts
    10
    Novice Brain Surgeon is an appropriate labal, you're a star.

    Cheers,

    Rob

  4. #4
    Join Date
    Feb 2002
    Location
    Houston, TX
    Posts
    809
    Actually, I hated the "Guru" label and was trying to be cute.
    Paul Young
    (Knowledge is power! Get some!)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •