SQL Server

Using metadata to troubleshoot metadata

I show how I tried to chase down a very unexpected issue with SQL Server metadata. Spoiler: it didn't end the way I thought it would.

Simulating ON DELETE CASCADE

See how to generate a set of scripts that will delete rows from dependent tables and show you how many rows will be deleted from each.

T-SQL Tuesday #119: Changing my mind

For this month's T-SQL Tuesday, I talk about an incident where I've changed my mind about something I was previously pretty stubborn about.

Document columns across systems

Find out how to use dynamic SQL to quickly generate metadata queries to pull attributes for all columns across a database or even a set of databases.

SQL Server Management Studio 18.2

One of the biggest downsides of using SQL Server Management Studio as an interactive query tool is the limit on text/grid output. SSMS 18.2 fixes that!

Find integer columns to downsize

In this tip, you'll see the metadata queries that will make it possible to discover which integer-based columns could be made smaller (without any loss of data).

Simplify date period calculations

See how you can use new functions like DATEFROMPARTS to simplify otherwise really cryptic methods to obtain key dates (like the first day of the current month).

CASE expression overview

This tip shows how powerful the CASE expression is, and some of the nuances in its behavior.

Table variable deferred compilation

I talk about the pros and cons of letting SQL Server wait to get a more accurate cardinality estimate from a table variable.

MERGE with caution

This tip was refreshed with status updates for some of the critical bugs discovered in MERGE over the years.

UNION and data type mismatches

Estimated data size as a result of implicit conversions can make a huge difference in the execution plan.