SQL Server Performance

logon logout auditing

Discussion in 'SQL Server 2005 General DBA Questions' started by avipenina, Jul 21, 2010.

  1. avipenina New Member

    Hi,
    I need to audit after logon and logout for users.
    i use this article http://www.sqlservercentral.com/articles/SQLServerCentral/sqlserver2005logontriggers/2366/
    but i need to adjust it for this scenario.
    i need to capture the first logon for the user and the last logout for the user and not all logon and logout that the user do while he is in the ERP.
    how can i adjust the script for that or do i need different approach?

    THX

  2. ghemant Moderator

    AFAIK there is nothing native that will give you this information directly. IMO you have to log an information for login and logout for users whole day and then filter out the data based on the date/day wise to get first login and last log out information.
  3. satya Moderator

    Simple option is to do a server-side trace by capturing the AUDIT Event from that instance.

Share This Page