Home Forums SQL Server 2008 T-SQL (SS2K8) Insert data into table The results of stored procedure RE: Insert data into table The results of stored procedure

  • To begin with, the results of each of the procedures will need to be inserted into their own tables.

    CREATE TABLE #FirstOutput (ServerName SYSNAME, Edition NVARCHAR(256), [Level] NVARCHAR(26))

    CREATE TABLE #SecondOutput (DatabaseName SYSNAME, Allocated_Size INT, FreeSize INT)

    CREATE TABLE #ThirdOutput (DatabaseName SYSNAME, UserName NVARCHAR(256), [Role] NVARCHAR(26))

    INSERT #FirstOutput

    EXEC storedProc1

    INSERT #SecondOutput

    EXEC storedProc2

    INSERT #ThirdOutput

    EXEC storedProc3

    From that point further, use these tables as the source of the final insert.

    ____________________________________________
    Space, the final frontier? not any more...
    All limits henceforth are self-imposed.
    “libera tute vulgaris ex”