Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fastest way to synchronize one field
Message
 
To
05/03/2012 15:37:26
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2008
Application:
Web
Miscellaneous
Thread ID:
01537311
Message ID:
01537324
Views:
34
This message has been marked as a message which has helped to the initial question of the thread.
>>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
>
>I still do not understand the two word terminology here in the syntax. If you look at the attached file, you will see that I have defined a linked server. There is only one name in there. It is hidden. Lets called it MyOtherServer. So, in the syntax, I have something like this:
>
>
>UPDATE Client
> SET Address=o.Address FROM Client m
> JOIN MyOtherServer.MyDatabase.Client o on o.Numero=m.Numero
>
To address a table you use Server.Database.Schema.Table, you can use only some of them only, for example if you are going to use a table in the server you are connected to and you already issued a "USE DATABASE" command (or if it is your default database) then you just need to specify Schema.Table in your select statement, furthermore, if the table is in your default schema, you do not need to use it at all so you have the commonly used SELECT * FROM TABLE, without specifying nothing else as SQL understands that you are querying the current server, the current database and the default schema. This leads to multiple combinations, where you can even skip one or more of the names, for example if you want to select from a table that is on the current server, different database, default schema then you can use SELECT * FROM differentDatabase..Table, the double dot is for I am using the my default schema for that database (lets assume it was dbo, so the previous is the same as SELECT * FROM differentDatabase.dbo.Table)

No, in your case I assume you are using a default instance (instead of a named instance) for your server, then the name of the server should be enough (this I am not sure as I avoid using default instances, I always name my server instances) otherwise I think you could use [Server\Server], let me put this in an example

I have a computer named myComputer and I have two instances of SQL server installed mySQL1 and mySQL2 so, if you want to extract data from the first instance you use [myComputer\mySQL1] as the server, if you want the data from the second instance then you use [myComputer\mySQL2], now if you want the data from the default instance, here I am guessing a bit, you can either use just [myComputer] or [myComputer\myComputer] (but I am sure that you should use the same as what appears in your linked servers item, which you blacked out) as name of the server.

One last thing, you are using JOIN MyOtherServer.MyDatabase.Client, which is missing the schema, so you should either use JOIN MyOtherServer.MyDatabase..Client (double dot, meaning default schema) or JOIN MyOtherServer.MyDatabase.mySchema.Client



so in your case
"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