Login Failed for linked server

时光怂恿深爱的人放手 提交于 2019-12-11 03:28:27

问题


How to create a linked server...?

1st Server name is ABC.DATABASE1
2nd server name is EFG.DATABASE2

EFG database username is sa password is sa

I want to retrive the data's from 2nd server thourgh 1st server

In the 1st server, i exectue the store procedure like this....

exec sp_linkedserver 'EFG'

Executed successfully,

When i tried to retrive the data, it is showing error as "login failed for user sa, Reason: Not associated with trusted sql server connection"

How to solve this problem...

Need help


回答1:


In Microsoft SQL Server Management Studio check the login configuration of your linked servers properties on the *Security" tab and create a mapped remote login for your local sa account or configure an alternative login for all connections.

To create a linked server with a login mapping by executing sp_linkedserver, try

sp_addlinkedsrvlogin @rmtsrvname = N'EFG', @locallogin = N'sa', @useself = N'False', 
                     @rmtuser = N'your_remote_user', @rmtpassword = N'remotepassword'

To create a linked server with an alternative login, try

sp_addlinkedsrvlogin @rmtsrvname = N'EFG', @locallogin = NULL , @useself = N'False', 
                     @rmtuser = N'your_remote_user', @rmtpassword = N'remotepassword'


来源:https://stackoverflow.com/questions/10569936/login-failed-for-linked-server

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