SQL Server Duplicate and Overlapping Index Detection Script
Duplicate and overlapping indexes waste storage, slow down every write, and split optimizer statistics across redundant copies. This T-SQL script compares each non-heap index in the current database on its first sixteen key columns and surfaces any pair of indexes that overlap, giving the DBA a short list of cleanup …
Read MoreSQL Server VLF Count Report: Virtual Log File Analysis
May 18, 2026 / · 7 min read · sql server virtual log files dbcc loginfo transaction log database maintenance sql scripts database administration log management performance sys.databases ·Excessive virtual log files (VLFs) inside the transaction log slow down database recovery, backup, and restore operations — often by minutes on large logs — and the problem compounds silently every time autogrowth fires with a small increment. This script queries DBCC LOGINFO across every online database on the …
Read MoreSQL Server DBCC CHECKDB Last Run Date Report
Apr 17, 2026 / · 7 min read · sql server dbcc commands database maintenance database integrity DBCC CHECKDB DBCC DBINFO dba scripts database administration sql server monitoring integrity check ·Running DBCC CHECKDB on every database is one of the most important tasks for a SQL Server DBA. But in busy environments it is easy to lose track of which databases have been checked recently and which have not. This script loops through all user databases, reads the last known good DBCC CHECKDB date from each one, and …
Read MoreSQL Server Index Fragmentation: dm_db_index_physical_stats
Apr 3, 2026 / · 6 min read · sql server index maintenance sql scripts sys.dm_db_index_physical_stats fragmentation database administration performance maintenance scripts indexes rebuild reorganize ·Report Index Fragmentation Across All Tables in SQL Server This script queries sys.dm_db_index_physical_stats to report external and internal fragmentation for every index in the current database, filtering to indexes with significant fragmentation and enough pages to make maintenance worthwhile. Purpose and Overview …
Read MoreSQL Server DBCC DBREINDEX with Timing: Index Maintenance
Aug 5, 2025 / · 4 min read · sql server database maintenance performance tuning dbcc commands index optimization dba scripts database administration sql scripts DBCC DBREINDEX sysobjects ·SQL Server DBCC DBREINDEX Script with Timing - Database Maintenance Guide Database maintenance is a critical aspect of SQL Server administration, and index rebuilding plays a vital role in maintaining optimal database performance. This comprehensive guide explores powerful DBCC DBREINDEX scripts that include timing …
Read MoreSQL Server DBCC DBREINDEX Script Generator: DB Maintenance
Aug 4, 2025 / · 4 min read · sql server database maintenance indexing performance tuning automation dbcc commands database administration optimization DBCC DBREINDEX sysobjects ·SQL Server DBCC DBREINDEX Script Generator for Database Maintenance Database maintenance is crucial for optimal SQL Server performance, and one of the most important tasks is maintaining database indexes. The DBCC DBREINDEX command is a powerful tool for rebuilding indexes, but manually running it on every table can be …
Read MoreGenerate DBCC SHOWCONTIG Commands for All SQL Server Tables
Generate DBCC SHOWCONTIG Commands for All User Tables in SQL Server Database administrators frequently need to monitor table and index fragmentation to maintain optimal database performance. This SQL Server script provides an efficient way to generate DBCC SHOWCONTIG commands for all user tables in your database …
Read More