SQL: SELECT TOP 100 PERCENT is a code smell for SQL Server
We help a lot of customers upgrade their systems. Part of that job involves looking for code smells before starting the upgrades. If you aren’t familiar with code smells, this Wikipedia article explains it pretty well: https://en.wikipedia.org/wiki/Code_smell.
Specifically, they describe a code smell as any characteristic in the source code of a program that possibly indicates a deeper problem.
One of these is the presence of TOP 100 PERCENT or perhaps written as TOP (100) PERCENT in SELECT queries. Almost always, we see this in the definition of views.
2018-06-11




