Login failed when querying linked server

别等时光非礼了梦想. 提交于 2019-12-04 12:27:20

The issue is that the SQL Server Management Studio interface creates the linked server using the OLEDB Provider:

This is equivalent to the original T-SQL:

--Create the link to server "uranium"
EXEC master.dbo.sp_addlinkedserver 
      @server = N'uranium', 
      @srvproduct=N'', @provider=N'SQLNCLI'

The fix is to create the linked server as SQL Server:

--Create the link to SQL Server "uranium"
EXEC master.dbo.sp_addlinkedserver 
      @server = N'uranium', 
      @srvproduct=N'SQL Server'

Shouldn't matter. Probably a regression in Microsoft SQL Server 2014 12.0.4213.0. Might be fixed in a service pack - if there is one.

But there it is; solved.

Old post, but might be useful still. In my case it was that only Windows Authentication was set. Setting authentication for both Windows and SQL Server on the linked server fixed it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!