找不到链接的服务器. [英] Linked Server cannot be found.

查看:105
本文介绍了找不到链接的服务器.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直试图在远程数据服务器上进行连接,但是一遍又一遍地给出相同的错误.

我的本地服务器在运行模式下,其图标上有一个绿色三角形,表示其正在运行.
我的链接服务器,其图标上有一个白色圆圈,我用鼠标指着鼠标右键单击它,但是[启动,停止,暂停,恢复和重新启动]被禁用.

当我运行程序时,我连接到本地服务器,然后用户从组合框中的列表中进行选择,从用户选择的列表中,它将创建一个连接字符串,运行该字符串以验证与链接的连接是否正确服务器成功,(它在我运行和调试该部分时执行.)

成功连接到链接服务器后,它将读取查询语句;

I''ve been trying to connect on the remote data server but keeps giving the same error over and over.

My local server, at running mode, has a green triangle on its icon, means that its running.
My linked server, has a white circle on its icon, I pointed my mouse and right clicked at it but [ Start, Stop, Pause, Resume and Restart ] are disabled.

When i run my program, i connect to my local server, the user then selects from a list in the combo box, from the list the user selects, it will create a connection string, run that string to validate if the connection to the linked server is successful, (which It does as I run and debug that part)..

After the successful connection to the linked server, It will read the Query Statement;

Select * from [linkedServer].DatabaseName..TableName

Select * from [linkedServer].DatabaseName.dbo.TableName


但仍然给出此错误;


but still gives this error;

Could not find server 'VMServer' in sys.servers. Verify that the correct server name was specified. If necessary, execute the stored procedure sp_addlinkedserver to add the server to sys.servers.


我发现了这一点,并在本地服务器上运行了一个测试,它成功了.


i found this and run a test at my local Server and it worked.

Exec sp_dropserver 'VMSERVER', 'droplogins'
go

EXEC sp_addlinkedserver   
    @server='VMSERVER', 
    @srvproduct='',
    @provider='SQLNCLI', 
    @datasrc='0.0.0.0'

EXEC sp_addlinkedsrvlogin
    @useself='FALSE',
    @rmtsrvname='VMSERVER',
    @rmtuser='sa',
    @rmtpassword='mbwin'
go


但是当我再次使用此语句运行它时,


but when i run it again with this statement,

Select Top 10 * from [VMSERVER].PUSAN_KRW_PROD.dbo.GLAC


并出现相同的错误.

我想念什么吗?
如果我可以粘贴屏幕截图以提出想法,但不知道如何做?


and the same error appeared.

Am i missing something?
If i can paste a screenshot to give an idea, but don''t know how?

推荐答案

用于该协议的协议似乎有问题名称解析.
SQL Server可以使用TCP/IP或命名管道提供程序.
在您的情况下,似乎可以使用.

尝试使用带有@选项="SQLOLEDB"而不是"SQLNCLI"的sp_addlinkedserver
It would seem like a problem with the protocol''s used for name resolution.
Sql server can use TCP / IP or Named Pipes provider.
In your case it seems that it uses.

Try to use sp_addlinkedserver with the @ option = ''SQLOLEDB'' instead of ''SQLNCLI''


构建连接字符串时,请输入服务器地址或链接地址服务器?
如果使用链接服务器的地址构建连接字符串,则必须删除[LinkedServer].从您的查询中获取.
When you build your connection string you enter the address of your server or the address of linked server?
If you build your connection string with the address of the linked server you have to remove [LinkedServer]. from your query.


这篇关于找不到链接的服务器.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆