How to update columns in one table from another table in desparate databases?

How to update columns in one table from another table in desparate databases?
I need to update my itemBackup table column itemdesc2 from data stored in another database (web) which includes my parts table column description.

UPDATE    itemBackup
SET              itemdesc2 = Web.dbo.Parts.Description
WHERE     (Web.dbo.Resale = 'y') AND (Web.dbo.Parts.PartID COLLATE database_default IN
                          (SELECT     item COLLATE database_default
                            FROM         itemBackup))
dawes4000Asked:
Who is Participating?
 
TommyTupaConnect With a Mentor Commented:
Oops, not that anyone will notice...but of course this is the correct syntax:
Update itemBackup
Set ItemDesc2 = b.PartsDescription
from itemBackup a
inner join WebServer.DBName.SchemaName.TableName  b
on a.item = b.partid
where b.Resale = 'Y'
0
 
TommyTupaCommented:
1. Go to Configuration Manager.
2. Create new SQL Alias to your server e.g. WebServer.
3. Test connection.
4. Go so SQL Server Management Studio and connect to local server.
5. Create Query:

Update itemBackup
Set ItemDesc2 = b.PartsDescription
from itemBackup a
inner join WebServer.DBName.SchemaName.Field b
on a.item = b.partid
where b.Resale = 'Y'

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.