简体   繁体   English

无法连接到链接服务器

[英]Can't connect to linked server

Why can't I access the table when I have linked it to the server?为什么将表链接到服务器后无法访问该表? What is wrong here?这里有什么问题? Thanks!谢谢!

EXEC sp_addlinkedserver   
     @server='172.xx.xxx.xx\ABC', 
     @srvproduct='',
     @provider='SQLNCLI', 
     @datasrc='ABC_XYZ'

SELECT * FROM [172.xx.xxx.xx\ABC].[ABC_XYZ].DBO.TABLETOACCESS

I keep getting:我不断得到:

OLE DB provider "SQLNCLI10" for linked server "172.xx.xxx.xx\ABC" returned message "Login timeout expired".
OLE DB provider "SQLNCLI10" for linked server "1172.xx.xxx.xx\ABC" returned message "A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.".
Msg 53, Level 16, State 1, Line 0
Named Pipes Provider: Could not open a connection to SQL Server [53]. 

You need to pass credential to linked server.您需要将凭据传递给链接服务器。 Quickest way is to use Wizzard.最快的方法是使用Wizzard。 SSMS -> Linked Servers -> Right Click -> Security Tab. SSMS -> 链接服务器 -> 右键单击​​ -> 安全选项卡。

Wizzard window 向导窗口

After you do this you can script button near title bar to get script.执行此操作后,您可以script button标题栏附近的script button以获取脚本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM