开发者

Help with Linked Server Error

开发者 https://www.devze.com 2023-01-01 15:37 出处:网络
In SSMS 2008, I am trying to execute a stored procedure in a database on another server. The call looks something like the following:

In SSMS 2008, I am trying to execute a stored procedure in a database on another server. The call looks something like the following:

EXEC [RemoteServer].Database.Schema.StoredProcedureName
   @param1,
   @param2

The linked server is set up correctly, and has both RPC and RPC OUT set to true. Security on the linked server is set to Be made using the login's current security context.

When I attempt to execute the stored procedure, I get the following error:

Msg 18483, Level 14, State 1, Line 1

    Could not connect to server 'RemoteServer' because '' is not defined as a remote login at the 开发者_如何转开发server. Verify that you have specified the correct login name.

I am connected to the local server using Windows Authentication. Anyone know why I would be getting this error?


'Be made using the login's current security context' translates as impersonation (aka. as 'self-mapping' in SQL Server linked in terms). Access a remote server under an impersonated context means delegation. So you need to set up the constraint delegation, see Configuring Linked Servers for Delegation:

Requirements for the Client

  • The Windows user must have access permissions to SQLSERVER1 and SQLSERVER2.
  • The user AD property Account is sensitive and cannot be delegated must not be selected.
  • The client computer must be using TCP/IP or named pipes network connectivity.

Requirements for the First/Middle Server (SQLSERVER1)

  • The server must have an SPN registered by the domain administrator.
  • The account under which SQL Server is running must be trusted for delegation.
  • The server must be using TCP/IP or named pipes network connectivity.
  • The linked server logins must be configured for self mapping.

Requirements for the Second Server (SQLSERVER2)

  • If using TCP/IP network connectivity, the server must have an SPN registered by the domain administrator.
  • The server must be using TCP/IP or named pipes network connectivity.


run the following command, and it may fix it for you

exec sp_AddRemoteLogin 'YourServerName','LoginName'

I think (not sure) that the passwords have to be the same on both machines.

0

精彩评论

暂无评论...
验证码 换一张
取 消