询问者
链接服务器查询失败,请问如何解决

问题
-
使用下面的语句建立链接服务器或者手工建立链接服务器
SET @dySQL='EXEC sp_addlinkedserver '''+@IP+''','''',''SQLOLEDB'','''+@IP+''''+char(13)
+'EXEC sp_addlinkedsrvlogin '''+@ServerName+''',''false'',null,'''+@LogonName+''','''+@Password+''''+char(13)
PRINT @dySQL
EXEC(@dySQL)一个简单的查询语句就出现如图错误,但是使用SQLSERVER MANAGEMENT STUDIO 可以连接到这个服务器
数据库版本都是2008+sp4- 已编辑 Tim-2009 2018年1月9日 2:19 补充信息
全部回复
-
Hi Tim-2009,
1231错误代表的是SQL Server无法在AD里面创建SPN,你检查一下SQL Server的账户有没有在AD中创建SPN的权限。
Best Regards,
Teige
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com. -
Hi Tim-2009,
1231错误代表的是SQL Server无法在AD里面创建SPN,你检查一下SQL Server的账户有没有在AD中创建SPN的权限。
Best Regards,
Teige
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com. -
什么叫看到的都是本机的内容,可以详细说一下或者截个图吗?有没有尝试用profiler抓取一下从linked server上运行query的过程?
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.- 已建议为答案 Teige GaoModerator 2018年2月14日 9:40