Last Backup Time comes from recorded history, which I check by backup type. Recovery still needs the files and a tested chain.
COUNT OVER: Show the Filtered Total Beside Page Rows
COUNT OVER helps me keep a page’s row count separate from the filtered total. Compare full and partial pages. An empty page needs an explicit total-count contract.
Find the Last Read and Write Time of Every Table in SQL Server
Find the last read and write time of every table in SQL Server with sys.dm_db_index_usage_stats. The tests show what counts as a read, why an insert counts as a write, what an index rebuild does to the numbers, and what wipes them.
SQL SERVER – List of all the Views from Database
Hundreds of Views and no idea which are indexed? A quick query on sys.views lists every view with its schema and whether it is indexed or indexable.
SQL SERVER – SQL Challenge – SQL Puzzle – Query Creating Most TempDB IO Usage
My SQL puzzle: which queries create the most TempDB IO and grow its size? Answer with any DMV, and all valid answers get published here with credit.
hierarchyid GetLevel: Count the Path Depth
hierarchyid GetLevel identifies depth within a logical path. The read-only example distinguishes the root, children, grandchildren and a fractional sibling label.







