Replace correlated subqueries with windowed counts, dates, and running totals, preserve detail rows, and keep useful EXISTS filters.
Check Constraint on Identity Column: Why Inserts Fail
A check constraint on identity column values can make every insert fail, because the identity moves on whether or not the row is accepted. This post reproduces the failure, shows that the failed attempts still use up identity values, and lists every such constraint in a database with one query.
Add Columns With NULL in SQL Server: ISNULL, COALESCE or SUM
To add columns with NULL in SQL Server, first decide what an empty value means. This post sums three nullable columns with the plus operator, ISNULL, COALESCE and SUM, shows where each one differs on a row of all NULLs, and compares their CPU cost on two million rows.
SQL SERVER – 7 Questions about OUTPUT Clause Answered
These 7 Questions about OUTPUT Clause follow my INSERT and DELETE videos. I clarify destinations, triggers and performance scope below.
Create Table From Another Table: What SELECT INTO Copies
To create table from another table in SQL Server, use SELECT INTO with WHERE 1 = 2 or TOP (0) for the structure alone. This post builds a demo table and compares it with its copy column by column. It shows the identity trap, the computed column that becomes plain, and the statements that add keys, defaults and indexes back.
Long-Term Backup Retention in Azure SQL Database
Configure long-term backup retention in Azure SQL Database, inspect retained recovery points, restore a separate copy, and review costs.







