What is the better way to update entire database

  • Hi,

    Our Database had a schema change--add 2 columns ( brand and type) to each of existing tables. The schema change has done. Now I am going to fill up the data into these 2 new added column base on location ID.

    So I will have the following date file

    LOC_ID Brand Type

    1 B E

    2 B F

    3 B F

    4 F E

    ....

    I need fill in these data into more than 30 tables in which there are thousands rows.

    What is the best way to do it.

    I am new to SQL please help me with this script

    Thanks in advance

  • What are the rules for updating Type and Brand how do these relate to the LOC_ID ?

    This situation looks like it could be handled better with a lookup table containing all the Types and Brands for each LOC_ID, then each of your tables could link to this when they need the information.

  • Thanks SteveB.

    Actually, I didn't explain it clearly.

    We are going to create a link table, but for each location specific tables we need add indetification ID to it. anyway, I have got it resolved.

    Sorry, response late as I was out of town for past few days

    Again Thanks for your advice and help

  • jds (6/26/2008)


    anyway, I have got it resolved.

    Two way street here... how did you resolve 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)

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

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