Update one table with another table in a different database

  • I have 2 identical tables in 2 different databases. I would like to update one with the other.

    If truncating and inserting is easier. That would work too. I am not sure how to do either one. The id for each row has to remain the same.

    This is what I have so far:

    UPDATE [database1].[dbo].[Faculty]

    SET [LongBio] =

    (SELECT LongBio

    FROM database2.dbo.faculty

    WHERE database2.dbo.faculty.FcultyID = database1.dbo.faculty.FcultyID)

    //LongBio has text datatype

    Thank you!

    Norbert

  • Sorry. Nevermind. I misspelled a field name.

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

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