Provides information about current logins and the associated users.
sp_helplogins [LoginNamePattern]
where
For more information about the LIKE operator, see Wildcard Characters in the Microsoft SQL Server Transact-SQL Reference.
This procedure reports information on logins. The output consists of two reports. The first report contains information about each login name, including whether a login is associated with a remote login. The second report contains information about users and aliases associated with each login name. The second report gathers information from all databases.
In most cases the width of each column in the output reports is reduced to the length of the longest data value under each column. No data values are truncated.
This example reports on all logins that begin with repl.
sp_helplogins 'repl%' LoginName SUID DefDBName DefLangName AUser ARemote --------------- ------ --------- ----------- ----- ------- repl_publisher 16382 master us_english NO no repl_subscriber 16383 master us_english yes no (2 row(s) affected) LoginName DBName UserName UserOrAlias --------------- -------------- --------------- ------------ repl_subscriber master repl_subscriber User repl_subscriber msdb repl_subscriber User (2 row(s) affected)
Note In the first report of Logins, repl_publisher has an AUser of NO, which indicates that it is unusual not to be a user.
Only the system administrator can execute this procedure.