Find Login in SQL Server

Are there any queries in SQL Server that return all login accounts and information about them? On SQL Server there is a virtual catalog table (a VIEW, or system table) called sys.sql_logins. You can run the above query and the results will return all Login created in SQL Server with information about them.

To retrieve all login accounts in SQL Server, run the following command.

 SELECT  * 
Ma ster.sys.sql_logins FROM ma ;

VIEW sys.sql_logins includes the columns below

Column Explanation of ten This is ten_dangnhap specified in the CREATE LOGIN command id_uynhem Number value giatri_duynhat The unique value specified in the CREATE LOGIN command type

Proxy type:

  1. S = SQL Server user
  2. U = Windows users
  3. G = Windows group
  4. A = application rights
  5. R = database permissions
  6. C = authentication is mapped
  7. K = asymmetric key is mapped
type_desc

Description for proxy types:

  1. SQL_USER
  2. WINDOWS_USER
  3. WINDOWS_GROUP
  4. APPLICATION_ROLE
  5. DATABASE_ROLE
  6. CERTIFICATE_MAPPED_USER
  7. ASSYMETRIC_KEY_MAPPED_USER
vohieu 0 or 1 immediately o Date / time to create a Login with the CREATE LOGIN command at the moment of the last Login date / time with the command ALTER LOGIN ten_cosodulieu_macdinh This is the default database in the CREATE LOGIN or ALTER LOGIN command. in the CREATE LOGIN or ALTER LOGIN command id_chungthuc This is the certificate used in the CREATE LOGIN or ALTER LOGIN command, 0 or 1, specified in the CREATE LOGIN or ALTER LOGIN command to initiate 0 or 1, specified in the CREATE LOGIN or ALTER command LOGIN makhau_bam Hash value of the password

Compatible in older versions

In older SQL Server versions, you can get all Login information using the SQL Server 2000 system table like sys.syslogins, using the command below.

 SELECT * 
FROM master.s ys.syslogins;

The system table sys.syslogins (SQL Server 2000) contains the following columns.

Column Explanation giatri_duynhat The unique value specified in the CREATE LOGIN page command does not apply immediately The Date / Time created Login with the CREATE LOGIN command immediately snapnhat Last login date / time with the command ALTER LOGIN accdate Not used totcpu No apply totio Not apply spacelimit Not applicable timelimit Not apply resultlimit Not apply ten This is ten_dangnhap specified in the CREATE LOGIN command. tendb The default database is the default language 0 or 1 default 0 or 1 number 0 or 1 number 0 or 1 number 0 or 1 admins 0 or 1 admin or 0 adminset 0 or 1 admin 0 or 1 adminodia 0 or 1 nguoitaodb 0 or 1 adminbulk 0 or 1 tendangnhap This is ten_dangnhap specified in the CREATE LOGIN command.

Previous article: DROP LOGIN command in SQL Server

The following article: CREATE USER command in SQL Server

4.5 ★ | 2 Vote

May be interested

  • How to Find Proxy Servers for PS4 ConsolesHow to Find Proxy Servers for PS4 Consoles
    today's tipsmake will show you how to find and edit your playstation 4's proxy server ip address. if you don't want to use a proxy server but your ps4 keeps asking for a proxy server address, the problem is usually with the path. internet transmission. let's learn how to fix, as well as how to set up your pc as a proxy server for ps4 to improve the download speed of your console.
  • How to log in to SSH server with GPG keyHow to log in to SSH server with GPG key
    maintaining ssh credentials is an important part of every administrator's security protocol. today's article will show you how you can reduce the keys you need to maintain by linking your ssh login information with your gpg key.
  • The difference between web server and app serverThe difference between web server and app server
    you have probably seen that the terms web server and app server are often used interchangeably as if they are related to the same thing and also facilitate the website to function properly. but in reality, they are not the same.
  • EXECUTE AS statement in SQL Server 2005EXECUTE AS statement in SQL Server 2005
    in this article, we will explain the effect of the new execute as statement in sql server 2005 - execute as. this is a very useful utility for database administrators sql server 2005 when they need to check the permissions of each user.
  • How to fix the error is not logged in UbuntuHow to fix the error is not logged in Ubuntu
    one of the most common and controversial errors that ubuntu users encounter is the login boot loop. when you try to log in to ubuntu after booting, you will be taken back to the login screen and the process is infinite.
  • How to Turn Off Password Login on a MacHow to Turn Off Password Login on a Mac
    turning off password login on a mac is a simple one or two-step process. in order to disable password login, simply access your system preferences and make a few changes to your users & groups settings. if you have filevault turned on, you...
  • Network basics: Part 3 - DNS ServerNetwork basics: Part 3 - DNS Server
    a dns server is a server that contains a database of public ip addresses and hostnames associated with them. in most cases, the dns server is used to resolve or translate those common names into ip addresses as required.
  • How to remove the Ease of Access button from the login screen in Windows 10How to remove the Ease of Access button from the login screen in Windows 10
    as its name suggests, ease of access menu tries to make windows 10 system equally easy to use for all users. you can find ease of access options from the windows settings page as well as the user account login screen.
  • How to Find Incoming Mail ServersHow to Find Incoming Mail Servers
    to receive mail in email readers such as outlook, thunderbird or email applications on your phone, you need to collect incoming mail server information, including incoming mail server address, software port and device protocol type. server (pop3 or imap). it sounds difficult, but actually everything is available and very easy to find once you know where it is hidden.
  • 5 How to fix the latest update of Facebook login error 20215 How to fix the latest update of Facebook login error 2021
    guide 5 ways to fix facebook login error, blocked facebook login most effectively today. please refer to ben here.