Populating Variable

  • Using a sp.  I have a small sql dilemma.  I’m using dynamic sql to obtain some column_names from table a.(table changes base on an investor).   Now I need to use the column list obtained from table a to populate variables from table b. with data  All columns extracted exists in table b .  Any suggestions.  Sql server 2000. 

  • I believe that what you are looking for may be solved with "dynamic SQL".  There has to be a thousand good postings on this forum about it... try a search for "Dynamic SQL".

    --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 2 posts - 1 through 1 (of 1 total)

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