Login History to find when a user was last login?

  • Is there any feature to see when a user lets say "sa" using a program name lets say "SSMS" used to connect to a particular SQL Server. Is there any built-in feature available in SQL Server 2016 onward to see last login history of any user who connected to SQL Server.

    I know it can be implemented using Login auditing, Loggon Triggers, trace etc. but I want to know if any new version is taking care of this history for audit purpose? 

    Regards,
    Shamshad Ali

  • Out of the box, no.

    You could have a look at the default trace. Also, if you have your security setting to log both successful and unsuccessful logins, you'll be able to see a login from the sa in the logs. Of course, if the sa hasn't logged in for an extended period of time, then you may not see any logins, as neither the Trace or Logs go back far enough.

    The only way to ensure you can always find out the last login time and date (going forward) would be to implement one of the items you've listed above.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • shamshad.ali - Monday, June 4, 2018 4:15 AM

    Is there any feature to see when a user lets say "sa" using a program name lets say "SSMS" used to connect to a particular SQL Server. Is there any built-in feature available in SQL Server 2016 onward to see last login history of any user who connected to SQL Server.

    I know it can be implemented using Login auditing, Loggon Triggers, trace etc. but I want to know if any new version is taking care of this history for audit purpose? 

    Regards,
    Shamshad Ali

    Hope you aware of Extended Event,
    Using this you may store the Audit information(Logon details) into the flat file and generate the report using sql query and send across as Daily Audit report.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply