Update Tabale Colum fron another sql instance

I have a server in 1 location: server\instance
this instance has a table:  table1
table has a colum: colum1

I have another server in location 2 with the same instance name and database structure but one of the colums does not replicate from location 1 to location 2.

what sql query would I use to replicate specific colum from location 1 server into location 2 server?
intellie_exAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

adatheladCommented:
Hi,

First you need to add location 1's db server as a linked server on location 2.
See (e.g.):
http://msdn2.microsoft.com/en-us/library/aa213778(SQL.80).aspx

Then, on location 2 this query will update Table1 Column1 with the data from location 1. Note the extra prefix in the table name ([Server].[Database].[dbo].[TableName])

UPDATE t1
SET t1.c1 = t2.c1
FROM Table1 t1
    JOIN [Location1Server\Instance].DatabaseName.dbo.Table1 t2 ON t1.PKField = t2.PKField
0
intellie_exAuthor Commented:
H Adathelad,

I added this question very late last night and might of missed some detail.

In table location 2 under this table, I always have new data but I only want this query to take specific rows where one of the colums has 8356 in it.  The rest of the colums I do not want.
0
adatheladCommented:
UPDATE t1
SET t1.c1 = t2.c1
FROM Table1 t1
    JOIN [Location1Server\Instance].DatabaseName.dbo.Table1 t2 ON t1.PKField = t2.PKField
WHERE t2.YourOtherColumn = 8356
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
intellie_exAuthor Commented:
I linked the server but getting error:

Msg 208, Level 16, State 1, Line 1
Invalid object name 'RPT_ITM_D'.
0
intellie_exAuthor Commented:
I need a query that will look at table in location 2 and only take rows that have 8653 in them and update the table in location 1.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2005

From novice to tech pro — start learning today.