Database was last accessed

  • Hi Guys,

    Does anyone perhaps have any idea how I can check when the database was last accessed?

    I have this script but it only brings back whats currently connected to the database and not when was the last time all the databases where accessed:

    select @@servername as ServerName, sd.name as DatabaseName,

    sp.loginame as LoginName, sp.hostname as HostName,

    sp.login_time as LoginTime, sp.last_batch as LastBatch,

    getdate() as RunDate

    from master..sysprocesses sp, master..sysdatabases sd

    where sp.dbid = sd.dbid

    GO

    Can anyone please assist?

    Regards

    IC

  • Logon trigger?

    Wilfred
    The best things in life are the simple things

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

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