SQL Server MVP Deep Dives, Volume 2
by Brad McGehee, Louis Davidson, Greg Low, Kimberly Tripp, Paul S. Randal, Kalen Delaney, Paul Nielsen
Chapter 37. Strategies for unraveling tangled code
Jennifer McCown
When you inherit an application or a database, you often become the proud owner of overly complex, poorly performing T-SQL code. These queries rarely come equipped with meaningful documentation or with system architects who are willing and able to explain the code.
This chapter covers several methods to make sense of the mess. The overall approach is to organize, break down, and then streamline the code to identify and remove some of the nastier coding mistakes and inefficiencies.
The sample database is a small model of a vending machine business, called VendCo. Tables in the VendUnit schema store data about each vending machine (including model and location information) and ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access