One extra space or a lowercase keyword gives you a second cached plan. See it in the cache, and learn what actually fixes it.
Where T-SQL Differs From the ANSI Standard
See where T-SQL differs from the ANSI standard in row limits, concatenation, NULL behavior, and practical query portability.
Add an XML Column to a Table: One Row, Many Related Values
To add an XML column to a table, use ALTER TABLE with the xml data type, and each row can then carry a list of related values. This post adds a Labels column to a Recipes table, fills it, checks that bad XML is refused, and asks questions with value() and exist(). It then builds the same data as a child table and compares what each design can enforce. Every result comes from SQL Server 2025.
Run a String as SQL: EXEC, Parameters and Four Traps
To run a string as SQL, you pass it to EXEC or to sp_executesql, and SQL Server runs the text as a statement. This post builds a string from pieces, shows why EXEC cannot take parameters, and adds them with sp_executesql. It also shows four traps: a variable the string cannot see, a NULL that empties the string, a variable that is too short, and a function that cannot run a string. Every result comes from SQL Server 2025.
INSERT With an Identity Column: Name the Columns, Skip the ID
INSERT with an identity column is simplest when you leave the identity column out, because SQL Server numbers the row for you. This post shows three common errors (8101, 544 and 213), two ways to read the new number back, and what DELETE and TRUNCATE do to the counter. Every result comes from SQL Server 2025.
Query Writing Strategy: Start From the Question, Then Build Outward
A good query writing strategy starts before you type SELECT: write the question down, find the tables that hold the answer, and build the query one table at a time. This post follows that plan on a small tea shop database with four tables, checks the row count after every join, and confirms the answer by a second route. Every result comes from SQL Server 2025.
What the model Database Passes to Every New Database
Audit the model database template for recovery model, options, objects, and file size, then verify growth settings on new databases.







