Reputation: 73
I have a linked ODBC server (not SQL Server) defined in my SQL Server Management Studio.
The only way I can query it is by using the OPENQUERY
command, and that's fine - but it doesn't allow visual query editing or any intellisense.
Is there a way of typing queries against linked servers that behave in the normal way, even an extension?
Upvotes: 1
Views: 788
Reputation: 81
You use 3-dot syntax, like this,
<server>.<database>.<schema>.<table>
but it works properly only with linked servers to other instances of MSSQL.
Upvotes: 1
Reputation: 1772
Try format like this:
<server>.<database>.<schema>.<table>
example:
select foo.id
from databaseserver1.db1.dbo.table1 foo
inner join databaseserver2.db1.dbo.table1 bar
on foo.name = bar.name
Upvotes: 2