UPDATE query - join tables from diff servers

  • I want to update the CustomerID field in the Customer table from Server "A" using the data in the CustomerID field in the Customer table from Server "B" by executing an UPDATE SQL statement like below. I don't want to link the servers at this point unless I have to.

    strSQLChange = "Update A.Customers Set A.Customers.CustomerID = B.Customers.CustID FROM B.Customers WHERE A.Customers.CustId = B.Customers.CustomerGUID"

  • Linked servers are generally the way to go -- I've found them flexible and efficient over the years. If you're averse to linked servers, you should look in BOL regarding OPENDATASOURCE and OPENROWSET (although I believe the underlying functionality is ultimately the same).

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

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