query to find Inactive users in SQL server

  • Hi,

    Could any1 help me how to find inactive users(e.g users who have not logged in for a long time) in SQL server???

  • SELECT name,accdate FROM master.dbo.syslogins

    http://technet.microsoft.com/en-us/library/ms178593.aspx

  • SELECT name,accdate FROM master.dbo.syslogins

    shows the creation date but i want the last login date when the user logged in for the last time

  • SQL doesn't track that automatically. You'll need custom auditing for that.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

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

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