Update query with a join

  • Is it possible to update one table, based on a join with another ?

    Example :

    UPDATE 1stTable INNER JOIN 2ndTable ON 1stTable.Field = 2ndTable.Field SET !stTable.Field = 2ndTable.field

    I can do this with Access but have not been able to do so in SQL 2000.

    Thanks

  • Yes like this

    UPDATE t1

    SET t1.Field = t2.field

    FROM 1stTable t1

    INNER JOIN 2ndTable t2 ON t2.Field = t1.Field

    but is this really a DTS question?

    Far away is close at hand in the images of elsewhere.
    Anon.

  • Thanks for your answer David (and comment).

    I suppose when one is working with DTS and because of the DTS this problem arises - One could classify it as probable an even possible - but not entirely so.

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

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