query for report of user logins in MSSQL

Iraj Akbari Sohi 0 Reputation points

Hello Good time everyone Does anyone know how to get a report of user logins in MSSQL that will display the days and number of user logins and logouts in the output?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,878 questions
SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,466 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Olaf Helper 41,101 Reputation points

    By default SQL Server don't log who logged-in in when, nor logged-out. You have to implement your own logging.

    0 comments No comments

  2. PercyTang-MSFT 12,426 Reputation points Microsoft Vendor

    Hi @Iraj Akbari Sohi

    As far as I know, you can get process information through sys.sysprocesses.


    But you need to get login and logout information, and there doesn't seem to be an existing query to do it.

    Best regards,

    Percy Tang

    0 comments No comments