Active Logins

  • Hi All,

    can any body provide me How to find out Active and inactive logins of a SQL server logins.

    Inactive logins means the logins which are not using for more than 1 year.

    Thanks in advance.

    Thank You.

    Regards,
    Raghavender Chavva

  • Raghavender (12/30/2008)


    Hi All,

    can any body provide me How to find out Active and inactive logins of a SQL server logins.

    Inactive logins means the logins which are not using for more than 1 year.

    Thanks in advance.

    The fast way ... Logins exist in the master database, stored in sysxlogins table then try this:

    SELECT NAME, DBNAME, ACCDATE AS Access_Date, CREATEDATE AS Created_Date, UPDATEDATE AS Updated_Date

    FROM MASTER..SYSLOGINS

    ORDER BY ACCDATE ASC

    Ordering by Accdate you will see the incative logins first then active logins or Order by AccDate Desc you will see Active Logins first then InActive Logins!

    It can be also other professional way how to see the logins active and inactive! :hehe:

    ============================================================
    SELECT YOUR PROBLEM FROM SSC.com WHERE PROBLEM DESCRIPTION =
    http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]

  • Thanks A Lot,

    it helped me.

    Will let you know if there is any issues.

    Thanks Again.

    Thank You.

    Regards,
    Raghavender Chavva

  • Apart this,

    can we change the active logins to inactive ?

    Thank You.

    Regards,
    Raghavender Chavva

  • Raghavender (12/30/2008)


    Apart this,

    can we change the active logins to inactive ?

    Simple no!

    These info are coming from Master database sys tables! You should write other code to enable or disable users or logins!

    Like this:

    ALTER LOGIN [your_login_name] DISABLE

    Maybe others have the best solution for you ...! :hehe:

    ============================================================
    SELECT YOUR PROBLEM FROM SSC.com WHERE PROBLEM DESCRIPTION =
    http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]

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

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