SQL - Connect to Linked Server with Named Instance

本秂侑毒 提交于 2019-11-29 11:55:40
Jhonny D. Cano -Leftware-

Check this

You can surround server name with brackets

Martin Kafka

the correct syntax is [ServerName\InstanceName].DatabaseName.dbo.TableName.

If you are using the default instance, you don't need to specify the instance name.

Example using the default instance: [MyServer].[MyDatabase].[MySchema].[MyTable]

NB: If you don't know your schema name, give [dbo] a try, since that is the default schema.

So something like this should work for you

SELECT *
FROM [MyTable] t
INNER JOIN [MyLinkedServer].[MyLinkedDatabase].[MyLinkedSchema].[MyLinkedTable] lt ON lt.Id = t.Id
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!