• kennyhuang0108 (9/22/2016)


    Thanks Sue.

    I meant the script I did earlier was to copy the data from columns in table 1 to columns in table2.

    Now both tables have the same data.

    next step I have to delete the data in table 1 which I already copied to table 2.

    Sorry...now I get what you mean with:

    remove the data from whatever I copied from table 1 to table 2 not delete the record.

    If you want to set the values you updated over in table 2 to NULL in table 1, you would just do the opposite update of table 1.

    Your first update was (changed to using t-sql syntax):

    update Table2

    SET B1 = B, C1 = C

    FROM Table1

    WHERE Table2.ColumnA =Table1.ColumnA

    So to set the values to null in table 1, the opposite would be:

    update Table1

    SET B = NULL, C = NULL

    FROM Table2

    WHERE Table2.ColumnA =Table1.ColumnA

    Sue