Microsoft Transact-SQL: The Definitive Guide by Jeffrey Garbus
According to industry studies, 70-80% of database performance problems are caused by poorly written transact-SQL code. Microsoft Transact-SQL: The Definitive Guide is a comprehensive guide to the T-SQL language written for the MS SQL Server 2008 developer having performance problems with SQL. The text includes case studies and examples demonstrating how to write or rewrite T-SQL source code. Some Topics covered include several ways of writing code for optimal performance and maintainability such as stored procedures versus dynamic SQL as well as subqueries versus joins; advanced SQL programming techniques including characteristic functions, common table expressions, refactoring, cubes, and dynamic queries; methods for identifying and fixing poorly written code including Profiler, DMVs, third-party tools, and reading query plans.