Insert Stored Procedure Results Into New Table Without Using OPENQUERY

  • Comments posted to this topic are about the item Insert Stored Procedure Results Into New Table Without Using OPENQUERY

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • This looks interesting; the problem it's addressing is one I've run into several times.

    There is a flaw in the article's presentation, though. The first code block ends prematurely, leaving

    " -- return a descriptive error message when the resultset metadata cannot be retrieved

    IF @column_list IS NULL

    THROW 50000, 'Stored procedure resultset metadata could not be retrieved', 1;

    -- add the columns to the requested table EXEC (N'ALTER TABLE ' + @table_name + ' ADD ' + @column_list); END GO"

    as part of the article text.

  • I've reported the fact that the rating for this article appears to have been deleted as has all of the discussion that used to be on this thread. It was a REALLY good discussion.

    --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)

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply