An introduction to GUIDs starts with one problem: two tables that both count from 1. This post merges two small shop tables, first with INT keys and then with UNIQUEIDENTIFIER keys, and shows how to create, read and sort GUIDs. It also answers common reader questions: adding GUIDs, finding the newest row and getting the new key back. 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.
Why Queries Recompile
Why queries recompile becomes clearer when you capture Extended Events causes and check schema changes, statistics, SET options, and temp tables.
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.
SQL SERVER – Identify Last User Access of Table using T-SQL Script
How do you find the last user access of a table? A question at TechEd India 2013 led to this quick DMV script. Keep in mind the data resets on restart.







