Poorly performing code should be thoroughly documented before we undertake a rewrite. It is easy to start grabbing and rewriting code only to get bogged down in nested if statements, while loops, or calls to other SQL objects. If we have an understanding of the desired functionality, as well, we can make the determination whether the current code should be refactored or if we should just start from scratch.
2. Documentation
Get Refactoring Legacy T-SQL for Improved Performance: Modern Practices for SQL Server Applications 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.