Home Forums SQL Server 2008 T-SQL (SS2K8) Update one table rows with another table if match found RE: Update one table rows with another table if match found

  • maruthipuligandla (11/9/2012)


    Hi,

    I'm having 2 tables, One table holds some numbers of type varchar and the other table holds the same numbers present in 1st table along with one extra column "NEW NUMBERS". Now i need to update the table 1 with new numbers from table 2 if old number in table 1 matches with table 2 old number..

    Also i need to write a condition like, Even though a match is found in table 2, if corresponding new number is empty or string like "MISSING", i should not then update.

    Please help me out ..

    Table 1

    old number

    Table 2

    old number new number

    Sorry I don't understand your requirement.

    Could you please post DDL of tables with sample records and expected output.