Data Files and Log Files are the two kinds of file every SQL Server database needs. This post explains what lives in each, why the log is written first, and how to list both with a query on sys.database_files.
What Is a Foreign Key, and What It Protects
What is a foreign key? It’s a column that must match a key in another table, and SQL Server refuses any value that has no match. This post shows the error it raises, the ON DELETE options, and why the foreign key column needs an index of its own.
SQL Code Generators: Let SSMS Write the Script for You
SQL Code Generators in SSMS turn clicks into T-SQL. This post shows the Script button on dialogs, the Generate Scripts wizard and Select Top 1000 Rows, plus the checks I run before I trust a generated script.
Using Management Studio: A First Tour of SSMS 22
Using Management Studio gets easier once you know where to look. This first tour of SSMS 22 covers the connection dialog, Object Explorer, the query window, running a query, reading the results and saving a .sql file, with one small demo script to follow along.
Converting Deprecated TEXT, NTEXT and IMAGE Columns Safely
Inventory deprecated TEXT, NTEXT and IMAGE columns, convert to MAX types, move small values in row, and measure logging and space costs.
SQL Code Comments: Notes Your Future Self Can Read
SQL Code Comments are the notes SQL Server skips and your teammates read. This post shows the two comment styles, what is worth writing in them, a header block for scripts and procedures, and how to stop a comment from lying after the code changes.
Keeping ACID Across More Than One Server
Understand a distributed transaction through two-phase commit, uncertain outcomes, coordinator recovery, and alternative business guarantees.
Joining Tables in SQL Server: INNER, LEFT and FULL Joins
Joining Tables lets one query combine rows from two tables that share a value. This post uses small Customers and Orders tables to show what INNER, LEFT and FULL OUTER joins return, how many rows each one gives, and how to read the rows that have no match.
Running SQL Code: Execute, Batches and GO in SSMS
Running SQL code in SSMS starts with F5 or the Execute button. This post covers running only a selection, what a batch is, why GO is not T-SQL, why variables disappear after GO, and how GO with a number repeats a batch.
Data and Information: Why Every Business Runs on a Database
Data and Information are not the same thing. Data is the raw facts a business stores, and information is the answer you get when a query processes them. This post uses a small bookshop table to show the difference, and why a database does the job better than a ledger or a spreadsheet.










