• subscribe
July 20, 2004 12:00 AM

Finding Login Counts and Creation Dates

SQL Server Pro
InstantDoc ID #43220

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..syslogins
GO

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..syslogins
GO

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 <your_database_name>
GO
SELECT COUNT(*)
   FROM sysusers
SELECT name, createdate
   FROM sysusers
GO

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



ARTICLE TOOLS

Comments
  • dnguyen27
    8 years ago
    Aug 03, 2004

    handy

You must log on before posting a comment.

Are you a new visitor? Register Here