Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Query

Author  Topic 

sqlfresher2k7
Aged Yak Warrior

623 Posts

Posted - 2011-10-11 : 11:15:33
I need a query to track users who are not accessing the databases for last 2 weeks.
This is to take databases offline incase of users are not accessing the database.

Sachin.Nand

2937 Posts

Posted - 2011-10-11 : 13:09:14
Create a log on trigger and audit the logins in a table through the trigger.If there are no entries for 2 weeks then you can drop it.

PBUH

Go to Top of Page

Cindyaz
Yak Posting Veteran

73 Posts

Posted - 2011-10-12 : 01:36:45
you can also enable successful/failed login audits and write a script to read from error logs about last successful logins. Though Logon triggers are a better way of accomplishing this task.

Go to Top of Page
   

- Advertisement -