A foreign key inventory needs both the constraint and its column pairings. I include schema names to identify each table clearly.
GROUPING_ID: Separate Stored NULL Values From ROLLUP Totals
GROUPING_ID helps me distinguish a stored NULL from a subtotal created by ROLLUP. Both can appear in the same column. I keep the grouping bits beside the numbers before adding presentation labels.
SQL SERVER – T-SQL Script to Attach and Detach Database
Detach Database operations remove a database from its instance without deleting its files. I preserve a recoverable backup before moving them.
SQL SERVER – T-SQL Script to Insert Carriage Return and New Line Feed in Code
Add a carriage return with CHAR(13) and a New Line Feed with CHAR(10) in T-SQL. Handy for formatting output, dynamic SQL with GO, and saving user text.
Refactoring a Long Stored Procedure Into Readable Steps
Learn refactoring a long stored procedure with output baselines, named temp tables, dead-code removal, and two-way EXCEPT checks before release.
The SQL Basics Almost Everybody Skips
Revisit SQL basics that change query results: NULL logic, logical processing order, grouped filters, and the difference between two common counts.






