Nobody remembers what the 3 means. Give each status code an approved name, let the database enforce it, and leave your data alone.
SQL SERVER – Simple Query to List Size of the Table with Row Counts
A simple query I run at customer sites to list every table with its size in MB and Row Counts, including used and unused space.
SQL SERVER – How to Find Row Count of Every Table in Database Efficiently?
How do you find the row count of every table in a database without a cursor? An interview question, answered with a fast query instead of a loop.
Temporal History Queries: Indexing the History Table for Speed
Your current table is tiny, but the AS OF question hides in the history table. See the reads before and after a key-first index, and what it costs.
Currency Rates by Effective Date: Designing the Lookup Table
Why did last quarter’s invoices change overnight? Probably because the rate table had no dates. Here is a lookup that remembers.
Special Icon on System-Versioned Table in SQL Server 2016 – Interview Question of the Week #101
Expanding tables in WideWorldImporters in SSMS 2016, you see an icon like a watch. It marks a System-Versioned table, also known as a temporal table.
Building Full Folder Paths From a Parent-Child Table
Your folder table stores only a name and a parent, so the full path has to be walked. I show the query, and how to catch the rows it quietly leaves out.







