Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON' in SQL Server 2008

ぃ、小莉子 提交于 2019-12-25 03:04:51

问题


I am executing a script by using file like below:

EXEC master.dbo.xp_cmdshell 'sqlcmd -d TE07 -S ServerName -i D:\TE07.sql'

When executing the above line I am getting the below error:

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

I have read a lot but I am not clear about this. In many articles it is define as a LinkedServer issue. Can anyone please suggest me.


回答1:


We have to use username and password also while executing the sql file using cmdshell:

EXEC master.dbo.xp_cmdshell ‘sqlcmd -D db_name -S server_name -U username -P password -i sqlfile’

Use the above format



来源:https://stackoverflow.com/questions/23292581/login-failed-for-user-nt-authority-anonymous-logon-in-sql-server-2008

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