Monday, March 26, 2012

Update a SQL table using link server and self join

Here is a small example of how to update a table by using link server and self join.


update a
set a.MobilePagePublished=b.MobilePagePublished,
a.MobilePageID = b.MobilePageID from dbo.cmsPage a
inner join [10.103.100.37].cms.dbo.cmsPage b on a.PageID=b.PageID
where b.ProductID = 234