Chapter 35. You see sets, and I see loops

Linchi Shea

Within the SQL Server community, the predominant view on writing T-SQL for performance is that you should think in sets instead of procedures. In addition, it follows that you should focus on what result you want in terms of the set operations, and let SQL Server figure out how to get the result under the hood. This view has served the community well, especially when developers versed in indexed sequential access method (ISAM)-style databases, such as Microsoft Access, migrate to SQL Server and carry with them the habit of interacting with databases on a row-by-row basis. The set-oriented approach is an effective counter measure to minimize the potential damage to SQL Server performance ...

Get SQL Server MVP Deep Dives Vol. 2 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.