SQL Server

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.

Cleaning up the master database

We've all accidentally placed objects in master. In this tip, I show how you can clean it up a little.

Avoid ORDER BY in views

I explain why you shouldn't bother adding ORDER BY to views in SQL Server.