My optimization rules of thumb for a slow running query: read the query plan first, turn scans into seeks, fix bookmark lookups with a covering index and more.
Using Synonyms to Simplify Cross-Database Queries
Using synonyms can hide a cross-database object name from callers, but permissions, dependency checks, and deployment still need care.
Drawing a Diagram of an Existing Database
A diagram of an existing database starts with real foreign keys, uses SSMS to reveal relationships, and records the important paths a picture misses.
SQL SERVER – Converting Subqueries to Joins
Developers often write subqueries where Joins would do, or the other way around. A short note on converting between the two, with links to my earlier examples.
SQL SERVER – Join Better Performance – LEFT JOIN or NOT IN?
LEFT JOIN or NOT IN: which one gives Join Better Performance? It depends on the data. Compare the two queries and their execution plans on AdventureWorks.
EOMONTH: Month Ends Are Different From DATEADD Month Clipping
EOMONTH gives me a month-end date when that is the actual reporting requirement. DATEADD moves a date by a month. These operations can agree for one step and disagree on the next.
SQL SERVER – Identifiers As Valid Object Names
Chi-Ho Min found you can skip parts of a four part name with dots, like servername…tablename. Here is how identifiers work as valid object names.






