2

Is it possible to get a timestamp for the last login for a given ID in SQL Server?

I'm attempting to clean up security on a SQL Server 2000 installation and what I'd like to do is just delete all the non-active logins.

1 Answer 1

4

This information is not stored anywhere in SQL Server. You would have to run a server side trace for the Audit Login/Logout events and then scan the files over time to determine if a login is being used or not.

You could also do this if you have Login auditing for successful logins enabled, but even with auditing enabled you will only be able to go back as far as your SQL errorlogs go. Additionally, you could write a job to write the signed in users to a table.

1
  • 1
    Yeah I wish I could say different but this is a common problem people encounter, especially when dealing with external compliance auditors. Oct 16, 2009 at 0:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .