Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.