Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fastest way to synchronize one field
Message
 
To
05/03/2012 14:55:02
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2008
Application:
Web
Miscellaneous
Thread ID:
01537311
Message ID:
01537316
Views:
37
>>If I understood you correctly now, you can create in your server a linked server to the one that has the correct data, then you can just use it in an update statement, something like
>>
>>
>>update yourDB.yourSchema.YourTable
>>set YourField = o.YourField from YourDB.YourSchema.YourTable m
>>join  [theOtherServer\theOtherInstance].YourDB.YourSchema.YourTable o on o.pk = m.pk
>>
>>
>>(Assuming the Schemas/Database also match, otherwise adjust as necessary.
>
>I created a linked server. I tested the connection and it works. But, when I type it in the query it does not want to recognize it. I mean the intellisense doesn't kick in. It's like there is something I need to put in front of the linked server name.
>
>In your example, what would be an example of theOtherServer and theOtherInstance?

CTRL+SHIFT+R will refresh the cache for intellisense, theOtherServer\theOtherInstance would be exactly what you have in your linked server, expand the "Linked Servers" item on object explorer and the name diplayed there is the one you need to type.

[Update]I did not mentioned it, but if you are using "theOtherServer\theOtherInstance" (ie with the backslash) then you must enclose it in square brackets as I put it in the original query
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform