top of page

Table Used most in SQL Server

  • Writer: Kunal Ranpura
    Kunal Ranpura
  • Jul 28, 2019
  • 1 min read

SELECT TOP (5) b.name AS TableName,

a.database_id,

a.singleton_lookup_count,

a.range_scan_count

FROM sys.dm_db_index_operational_stats(DB_ID(), NULL, NULL, NULL) AS a

INNER JOIN sys.objects b on a.object_id = b.object_id

WHERE b.type <> 'S'

AND

(a.singleton_lookup_count > 0 OR a.range_scan_count > 0)

ORDER BY a.singleton_lookup_count DESC

GO

Recent Posts

See All

Comments


bottom of page