Easily-Identified T-SQL Anti-Patterns

So far, we have been learning the building blocks of writing T-SQL code: T-SQL basics, query optimization fundamentals, reading and interpreting query plans, and some general best practices around indexing and writing efficient T-SQL code. By this point, we should have a good understanding of how to write an efficient query, but there are some common pitfalls that even experienced T-SQL developers can encounter that will make a query perform poorly.

In this chapter, we will examine some common T-SQL patterns and anti-patterns, specifically those that should be easily identified just by looking at the T-SQL code. We will cover the following topics:

  • The perils of SELECT *
  • Functions in our predicate
  • Deconstructing ...

Get Learn T-SQL Querying now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.