Home Forums SQL Server 2008 T-SQL (SS2K8) How to execute stored procedure and save the results into temp table in mssql 2000 RE: How to execute stored procedure and save the results into temp table in mssql 2000

  • raghuldrag - Thursday, December 7, 2017 12:30 AM

    Hi friends,

    I have one stored procedure Test_db_list it ll display result depends on date range i have to store this results into temp table of another procedure

    Kindly give suggestion

    Create a ## temp table, insert the result set into the ## temp from SP1, execute SP2, drop ## temp, need to ensure the code of SP2 references the ## temp table


    CREATE TABLE ##Temp (ID INT)
    go
    INSERT INTO ##Temp
    EXEC SP1
    go
    EXEC SP2
    go
    DROP TABLE ##TEMP