Thursday, November 1, 2012

Find the last time all databases were used

select stat.database_id as database_id ,db.name as database_name ,max(stat.last_user_scan) as last_user_scan from sys.dm_db_index_usage_stats as stat join sys.databases as db on db.database_id = stat.database_id group by stat.database_id,db.name order by db.name asc

Can I upgrade my SQL Server 2008 R2 Trial to a full version?

If you are a GUI person just launch the SQL Server setup and go to the “Maintenance Tab”, you will see the “Edition Upgrade” option there. Follow a couple of steps in the wizard, provide the key and you are all set.