Created
November 5, 2024 00:03
-
-
Save LetsGoRafting/a27ea9f822d59cd4f4b30dd02a01f318 to your computer and use it in GitHub Desktop.
last run queries is server being used
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Use <DBName>; | |
| Select OBJECT_SCHEMA_NAME(I.object_id) + N'.' + OBJECT_NAME(I.object_id) As TableName, | |
| I.name As IndexName, | |
| I.index_id As IndexID, | |
| IUS.user_seeks, | |
| IUS.user_scans, | |
| IUS.user_lookups, | |
| IUS.user_updates, | |
| IUS.last_user_seek, | |
| IUS.last_user_scan, | |
| IUS.last_user_lookup, | |
| IUS.last_user_update | |
| From sys.indexes As I | |
| Inner Join sys.dm_db_index_usage_stats As IUS | |
| On IUS.object_id = I.object_id | |
| And IUS.index_id = I.index_id; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment