Inner join on multiple db's

firestrike

New member
Joined
Feb 5, 2009
Messages
1
Hello,

I have a temp2 table in a MSSQL server. This table has the columns country, mfr, item, and unit_of_measure. Country, mfr, and item are the primary key, and has data. Unit_of_measure is currently null. I need to run an update from a teradata table. The teradata table, called bob also has country, mfr, and item, as the key. It also has a Unit_of_measure, which is filled in. I was hoping that I could use an SQL statement like the following, but cannot figure out how to use it across 2 different databases.

update mssql_temp2 inner join teradata_bob
on (mssql_temp2.mfr = teradata_bob.mfr_no)
AND (mssql_temp2.Country = teradata_bob.country_code)
AND (mssql_temp2.item = teradata_bob.item_no)
set mssqltemp2.unit_of_measure_id = teradata_bob.unit_of_measure_id
 
Back
Top