[フレーム][フレーム]

Finding Login Counts and Creation Dates

Several example queries against syslogins and sysusers can give you the login and user information you need.

ITPro Today logo in a gray background | ITPro Today

How can I find out how many logins are in a SQL Server database and when they were created?

Here are several queries that return information about logins on your SQL Server. To find the count of logins on your SQL Server, you can execute the following query:

SELECT COUNT(*) FROM master..sysloginsGO

You can execute the next query to get a list of logins on your server as well as the creation date of each login:

SELECT name, createdate FROM master..sysloginsGO

Similarly, you can execute the following queries in a database to find the count of users for that database, a list of the user names, and the dates the users were created:

USE GOSELECT COUNT(*) FROM sysusersSELECT name, createdate FROM sysusersGO

These queries should give you the login and user information you need.

You May Also Like


Important Update

ITPro Today ended publication on September 30, 2025.

Learn More

AltStyle によって変換されたページ (->オリジナル) /