selectso.name,last_user_seek = max(last_user_seek),last_user_scan = max(last_user_scan),last_user_lookup = max(last_user_lookup),last_user_update = max(last_user_update)fromsys.dm_db_index_usage_stats sinner join sysobjects soon s.object_id = so.idwhere[database_id] = db_id()group byso.name
Wednesday, 8 January 2014
Find last time a table has been accessed
The following SQL script will give you information about the last time a table has been accessed, or updated:
Subscribe to:
Post Comments (Atom)
Updating massive amount of rows whilst avoiding blocking
The following SQL is a good means to split an update on a massive table into smaller chunks, whilst reducing blocking. The method is to upda...
-
Microsoft Distributed Transaction Coordinator (abbreviated to MSDTC, or DTC) is usually very quick and simple to set up. However, it isn...
-
Migrations between SQL Servers can be laborious, and doing them manually leaves a lot of room for human error. Scripting a migration using t...
-
Scheduling SSIS packages from SQL Agent can produce the following error on a new installation of SQL Server: “Connecting to the Integration...
No comments:
Post a Comment