SQL Server emergency? Email pinal@sqlauthority.com with URGENT in the subject line.

Introduction to GUIDs: Merge Tables Without Key Clashes

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.

Continue Reading

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.

Continue Reading