Simple Question..login audit

  • Does anyone know what tables if any track user logins when the audit option is turned on?

     

    TIA


    Mathew J Kulangara
    sqladventures.blogspot.com

  • The logins are recorded in the error log.  As far as I know, the login event is not stored in a table.

    I use the following query to filter log data.  You could modify the WHERE clause to look for entries of interest.

     

    DROP TABLE #Errors

    CREATE TABLE #Errors (vchMessage varchar(255), ID int)

    CREATE INDEX idx_msg ON #Errors(ID, vchMessage)

    INSERT #Errors EXEC master..xp_readerrorlog

    SELECT vchMessage FROM #Errors

    WHERE vchMessage NOT LIKE '%Log backed up%'

      AND vchMessage NOT LIKE '%Database backed up%'

      AND vchMessage NOT LIKE '%.TRN%'

      AND vchMessage NOT LIKE '%.BAK%'

      AND vchMessage NOT LIKE '%Copyright (c)%'

      AND vchMessage NOT LIKE '%All rights reserved%'

      AND vchMessage NOT LIKE '%SurfControl_web%'

      AND vchMessage NOT LIKE '%Error: 9002%'

      AND vchMessage NOT LIKE '%DBCC CHECKDB%'

    ORDER BY  ID

     

     

    Hope this helps.

Viewing 2 posts - 1 through 1 (of 1 total)

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