Last time a user was connected

  • Is it possible to find out when a user was connected last time?

  • If you are auditing connections, this ought to be in the Windows security log. Otherwise, I don't think so.

  • Thanks Steve, no i am not auditing the connections.

  • If Default Trace is running, then a query similar to the one below can be used.

    SELECT

    LoginName,max(StartTime)AS LoginTIme

    FROM ::fn_trace_gettable('C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\log_493.trc',0)

    where LoginName='loginname'

    GROUP BY LoginName

    This information is dependent on the availability of the trace files, since they get rolled over.

    Pradeep Adiga
    Blog: sqldbadiaries.com
    Twitter: @pradeepadiga

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

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