Avatar of PeterBaileyUk
PeterBaileyUk
 asked on

sql server cross db update

I have a query which works on the select but I dont know how to create the update so thattw.marque in tblwords in db dictionary get updated to tcwa.sCWDescGroup from the clientdata db

--UPDATE [dictionary].[dbo].[TblWords]
--SET tw.Marque=tcwa.sCWDescGroup
SELECT tw.ClientCode, tab2.[MVRIS CODE], tab2.MARQUE, tcwa.sCWDesc, tcwa.sCWDescGroup, tcwa.sCWTechnicalGroup
FROM [dictionary].[dbo].[TblWords] tw
    INNER JOIN [clientdata].[dbo].[smmt] tab2
        ON tw.ClientCode = tab2.[MVRIS CODE]
		 inner JOIN ClientData.[dbo].[tCWAlias] tcwa ON tab2.MARQUE=tcwa.sCWDesc
		 WHERE tcwa.sCWTechnicalGroup='name'
		 group BY tw.ClientCode, tab2.[MVRIS CODE], tab2.MARQUE, tcwa.sCWDesc, tcwa.sCWDescGroup, tcwa.sCWTechnicalGroup

Open in new window

SQLMicrosoft SQL Server

Avatar of undefined
Last Comment
PeterBaileyUk

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Megan Brooks

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
PeterBaileyUk

ASKER
thank you apologies for the delay.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes