Getting information about login accounts

Use sp_displaylogin to display information about a specified login account—or login names matching a wild-card pattern—including any roles granted, where loginame (or the wildcard matching pattern) is the user login name pattern about which you want information:

sp_displaylogin [loginame | wildcard]

If you are not a system security officer or system administrator, you can display information only about your own account. If you are a system security officer or system administrator, you can use the loginame | wildcard parameter to access information about any account.

sp_displaylogin displays your server user ID, login name, full name, any roles that have been granted to you, date of last password change, default database, default language, whether your account is locked, any auto-login script, password expiration interval, whether password has expired, the login password encryption version used, and the authentication mechanism specified for the login.

sp_displaylogin displays all roles that have been granted to you, so even if you have made a role inactive with the set command, that role appears. For example, this displays the roles for the sa:

sp_displaylogin 'mylogin'
Suid: 121
Loginame: mylogin
Fullname:
Default Database: master
Default Language:
Auto Login Script: 
Configured Authorization:
        sa_role (default ON)
        sso_role (default ON)
        oper_role (default ON)
        sybase_ts_role (default ON)
Locked: NO
Date of Last Password Change: Aug 10 2006 11:17AM
Password expiration interval: 0
Password expired: NO
Minimum password length: 6
Maximum failed logins: 0
Current failed login attempts:
Authenticate with: NONE
Login password encryption: SYB-PROP, SHA-256
Last login date : Aug 17 2006 5:55PM
(return status = 0)