View Snapshot Isolation Disk Usage
A query that reports snapshot isolation version store disk usage per database relative to tempdb.
Snapshot isolation stores row versions in tempdb, and a runaway snapshot transaction can fill it. This query compares each database's version store space usage against tempdb's total page count - reporting reserved pages and kilobytes, the snapshot's percentage of tempdb, and how full tempdb is overall.
SELECT
DB_NAME(vssu.database_id) AS DatabaseName,
SUM(vssu.reserved_page_count),
SUM(vssu.reserved_space_kb),
SUM(tdbu.total_page_count) as tempdb_pages,
SUM((vssu.reserved_page_count * 100.0) / (tdbu.total_page_count + 0.0)) AS [Snapshot %],
SUM((tdbu.allocated_extent_page_count * 100.0) / (tdbu.total_page_count + 0.0)) AS [tempdb % used]
FROM
sys.dm_tran_version_store_space_usage as vssu
CROSS JOIN tempdb.sys.dm_db_file_space_usage as tdbu
GROUP BY
DB_NAME(vssu.database_id)