Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Fastest way to synchronize one field
Message
 
À
05/03/2012 14:55:02
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Web
Divers
Thread ID:
01537311
Message ID:
01537316
Vues:
38
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform