Provides information about login mappings defined against a specific linked server used for distributed queries and remote stored procedures.
sp_helplinkedsrvlogin [[@rmtsrvname =] 'rmtsrvname',]
[[@locallogin =] 'locallogin']
0 (success) or 1 (failure)
Column name | Data type | Description |
---|---|---|
Linked Server | sysname | Linked server name. |
Local Login | sysname | Local login for which the mapping applies. |
Is Self Mapping | smallint | 0 = Local Login is mapped to Remote Login when connecting to Linked Server.
1 = Local Login is mapped to the same login and password when connecting to Linked Server. |
Remote Login | sysname | Login name on Linked Server that is mapped to Local Login when Is Self Mapping is 0. If Is Self Mapping is 1, Remote Login is NULL. |
Before deleting login mappings, use sp_helplinkedsrvlogin to determine the linked servers that are involved.
Execution permissions default to the public role.
This example displays all login mappings for all linked servers defined on the local computer running SQL Server.
EXEC sp_helplinkedsrvlogin
go
Linked Server Local Login Is Self Mapping Remote Login
---------------- ------------- --------------- --------------
Accounts NULL 1 NULL
Sales NULL 1 NULL
Sales Mary 0 sa
Marketing NULL 1 NULL
(4 row(s) affected)
This example displays all locally defined login mappings for the Sales linked server.
EXEC sp_helplinkedsrvlogin 'Sales'
go
Linked Server Local Login Is Self Mapping Remote Login
---------------- ------------- --------------- --------------
Sales NULL 1 NULL
Sales Mary 0 sa
(2 row(s) affected)
This example displays all locally defined login mappings for the login Mary.
EXEC sp_helplinkedsrvlogin NULL, 'Mary'
go
Linked Server Local Login Is Self Mapping Remote Login
---------------- ------------- --------------- --------------
Sales NULL 1 NULL
Sales Mary 0 sa
(2 row(s) affected)
Security for Linked Servers | sp_droplinkedsrvlogin |
sp_addlinkedserver | System Stored Procedures |