You run a query against a table. The column is indexed. The statistics are fresh. And yet the query does a full scan, takes ten times longer than it should, and you have no idea why. The code looks correct. The data looks correct. Nothing looks wrong. The culprit is a single mismatched data type, and SQL Server fixed it for you without saying a word. What is an implicit conversion? Every comparison SQL Server makes requires both sides to …

SQL Code Smells: Implicit Conversions Read more »