SQL SERVER linked server Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'

昨天创建了一个View, 这个view是一系列的表达式(CTE)组成,封装了好多的业务逻辑,简化下语句如下

;with CTE AS(

...
)

SELECT a.company_id
,b.company_name

FROM #company_tech a
LEFT JOIN dim.company b ON a.company_id = b.company_id
LEFT JOIN [lindedserver].[DB].[kg].[viw_Maping] c ON a.tech_stack = c.Synonym

结果: 同事 review 数据的时候报以下错误。 select * from [dbo].[viw_so_job_tech_stack] with(nolock)

Msg 18456, Level 14, State 1, Line 1
Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.

但是我自己run这个view的数据是没有任何问题的,一时间傻眼了。查找各种问题,都不能理解。明明我是可以run的,但是其他team member就是face errors。

这个问题的根源:linked server

 

DW(B)上面创建Source(A)的Linked server(用SQL 用户名密码创建). 但我在B上面创建view(取A的数据)时候,这个view是没有问题的。

当我用client(C)链接到DW(B)的时候就出现了身份认证错误。

下面是msdn给我们提供的解决方案。

https://blogs.msdn.microsoft.com/sql_protocols/2006/08/10/sql-linked-server-query-failed-with-login-failed-for-user/

本人建议用SSIS 把相关数据从SOURCE同步到本地比较好。

 

转载于:https://www.cnblogs.com/Jesse-Li/p/7462169.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
SQL Server 2012 Data Integration Recipes provides focused and practical solutions to real world problems of data integration. Need to import data into SQL Server from an outside source? Need to export data and send it to another system? SQL Server 2012 Data Integration Recipes has your back. You'll find solutions for importing from Microsoft Office data stores such as Excel and Access, from text files such as CSV files, from XML, from other database brands such as Oracle and MySQL, and even from other SQL Server databases. You'll learn techniques for managing metadata, transforming data to meet the needs of the target system, handling exceptions and errors, and much more. What DBA or developer isn't faced with the need to move data back and forth? Author Adam Aspin brings 10 years of extensive ETL experience involving SQL Server, and especially satellite products such as Data Transformation Services and SQL Server Integration Services. Extensive coverage is given to Integration Services, Microsoft's flagship tool for data integration in SQL Server environments. Coverage is also given to the broader range of tools such as OPENDATASOURCE, linked servers, OPENROWSET, Migration Assistant for Access, BCP Import, and BULK INSERT just to name a few. If you're looking for a resource to cover data integration and ETL across the gamut of Microsoft's SQL Server toolset, SQL Server 2012 Data Integration Recipes is the one book that will meet your needs. * Provides practical and proven solutions towards creating resilient ETL environments * Clearly answers the tough questions which professionals ask * Goes beyond the tools to a thorough discussion of the underlying techniques * Covers the gamut of data integration, beyond just SSIS * Includes example databases and files to allow readers to test the recipes

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值