0
I want to update the ordem_subclass column of the Prod_serv Table, and the reference are the codecolumns of the Prod_serv Table and code of the Subclass Table:
USE S9_Real
UPDATE Prod_Serv SET
Ordem_Subclasse = SC.ORDEM
FROM Prod_Serv PS
INNER JOIN S9_Real_MP2.DBO.Prod_Serv MP2PS ON PS.Codigo = MP2PS.Codigo
INNER JOIN S9_REAL_MP2.DBO.Subclasses MP2SC ON PS.Codigo = MP2PS.Codigo
INNER JOIN Subclasses SC ON SC.Codigo = MP2SC.Codigo
WHERE SC.Codigo = MP2SC.Codigo
what is the database? add a tag to help anyone who reads your question. at first you can make a link between the two databases
– Ricardo Pontual
The Source database is S9_real_mp2 and Destination S9_real.
– Marcondes Reis
that’s not it, I mean if it’s
sql-server
,mysql
,oracle
etc.– Ricardo Pontual
Sorry, the database is sql-server 2012.
– Marcondes Reis
in this case you need to connect the servers through a link server, then you can select/update from one server to another, something like
update campo=select campo from servidor.dbo.tabela
– Ricardo Pontual