Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 3 down vote accepted

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.

share|improve this answer
I was afraid of that. Thanks Jonathan. – user21146 Oct 16 '09 at 0:27
Yeah I wish I could say different but this is a common problem people encounter, especially when dealing with external compliance auditors. – Jonathan Kehayias Oct 16 '09 at 0:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.