Home Forums SQL Server 2008 T-SQL (SS2K8) t-sql load values from stored procedure into a temp table RE: t-sql load values from stored procedure into a temp table

  • wendy elizabeth (5/8/2014)


    I would like to know if the following sql can be used to obtain specific columns from calling a stored procedure with parameters:

    /* Create TempTable */

    CREATE TABLE #tempTable (MyDate SMALLDATETIME, IntValue INT)

    GO

    /* Run SP and Insert Value in TempTable */

    INSERT INTO #tempTable (MyDate, IntValue)

    EXEC TestSP @parm1, @parm2

    If the above does not work or there is a better way to accomplish this goal, please let me know how to change the sql?

    Gosh... instead of waiting for an answer from a forum, just try it. 😉

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)