sp_helpremotelogin (Transact-SQL)sp_helpremotelogin (Transact-SQL)

适用对象: 是SQL Server 否Azure SQL 数据库 否Azure Synapse Analytics (SQL DW) 否并行数据仓库APPLIES TO: yesSQL Server noAzure SQL Database noAzure Synapse Analytics (SQL DW) noParallel Data Warehouse

报告在本地服务器上定义的某个或所有远程服务器的远程登录名的相关信息。Reports information about remote logins for a particular remote server, or for all remote servers, defined on the local server.

重要

下一版本的 Microsoft SQL Server 将删除该功能。This feature will be removed in the next version of Microsoft SQL Server. 请不要在新的开发工作中使用该功能,并尽快修改当前还在使用该功能的应用程序。Do not use this feature in new development work, and modify applications that currently use this feature as soon as possible. 请改用链接服务器和链接服务器存储过程。Use linked servers and linked server stored procedures instead.

主题链接图标 Transact-SQL 语法约定Topic link icon Transact-SQL Syntax Conventions

语法Syntax

  
sp_helpremotelogin [ [ @remoteserver = ] 'remoteserver' ]   
     [ , [ @remotename = ] 'remote_name' ]  

参数Arguments

[ @remoteserver = ] \ "remoteserver"[ @remoteserver = ] 'remoteserver'
远程服务器,将返回其远程登录名信息。Is the remote server about which the remote login information is returned. remoteserver的值为sysname,默认值为 NULL。remoteserver is sysname, with a default of NULL. 如果未指定remoteserver ,则返回在本地服务器上定义的所有远程服务器的相关信息。If remoteserver is not specified, information about all remote servers defined on the local server is returned.

[ @remotename = ] 'remote_name'[ @remotename = ] 'remote_name'
远程服务器上的特定远程登录名。Is a specific remote login on the remote server. remote_name的默认值为sysname,默认值为 NULL。remote_name is sysname, with a default of NULL. 如果未指定remote_name ,则返回有关为remoteserver定义的所有远程用户的信息。If remote_name is not specified, information about all remote users defined for remoteserver is returned.

返回代码值Return Code Values

0(成功)或 1(失败)0 (success) or 1 (failure)

结果集Result Sets

列名称Column name 数据类型Data type 说明Description
serverserver sysnamesysname 本地服务器上定义的远程服务器的名称。Name of a remote server defined on the local server.
local_user_namelocal_user_name sysnamesysname 本地服务器上的登录名,来自服务器的远程登录名映射到该登录名。Login on the local server that remote logins from server map to.
remote_user_nameremote_user_name sysnamesysname 远程服务器上的登录,该登录映射到 local_user_name。Login on the remote server that maps to local_user_name.
选项options sysnamesysname Trusted = 从远程服务器连接到本地服务器时,远程登录名不需要提供密码。Trusted = The remote login does not need to supply a password when connecting to the local server from the remote server.

Untrusted(或空白)= 从远程服务器连接到本地服务器时,提示远程登录名提供密码。Untrusted (or blank) = The remote login is prompted for a password when connecting to the local server from the remote server.

备注Remarks

使用 sp_helpserver 列出在本地服务器上定义的远程服务器的名称。Use sp_helpserver to list the names of remote servers defined on the local server.

权限Permissions

未检查任何权限。No permissions are checked.

示例Examples

A.A. 报告关于单个服务器的帮助Reporting help on a single server

以下示例显示远程服务器 Accounts 上的所有远程用户的相关信息。The following example displays information about all remote users on the remote server Accounts.

EXEC sp_helpremotelogin 'Accounts';  

B.B. 报告关于所有远程用户的帮助Reporting help on all remote users

以下示例显示本地服务器已知的所有远程服务器上的所有远程用户的相关信息。The following example displays information about all remote users on all remote servers known to the local server.

EXEC sp_helpremotelogin;  

另请参阅See Also

sp_addremotelogin (Transact-sql) sp_addremotelogin (Transact-SQL)
sp_dropremotelogin (Transact-sql) sp_dropremotelogin (Transact-SQL)
sp_helpserver (Transact-sql) sp_helpserver (Transact-SQL)
sp_remoteoption (Transact-sql) sp_remoteoption (Transact-SQL)
系统存储过程 (Transact-SQL)System Stored Procedures (Transact-SQL)