Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2009

    Unanswered: Get a List of Last date Database access in SQL Server 2000


    I had tried on my local server for the getting details who are last date accessed database in sql server 2000.

    select as DBName,a.login_time,a.last_batch,a.hostname,a.prog ram_name,a.hostprocess,
    a.nt_domain,a.nt_username,a.net_address,a.net_libr ary,a.loginame
    from sysprocesses a, sysdatabases b where a.dbid=b.dbid order by a.last_batch desc

    Can anyone give me sql script for getting all remote server detail.


  2. #2
    Join Date
    Jun 2009
    CA, USA
    You get the last access after the reboot only...what happens some accessed the database but later you restarted the sql and no one logged this case you get null means it is incorrect result...

    If you want to do for remote servers you can use either BCP/OSQL...
    SQL Server MVP

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts