Book Image

Learn T-SQL Querying

By : Pedro Lopes, Pam Lahoud
Book Image

Learn T-SQL Querying

By: Pedro Lopes, Pam Lahoud

Overview of this book

Transact-SQL (T-SQL) is Microsoft's proprietary extension to the SQL language used with Microsoft SQL Server and Azure SQL Database. This book will be a usefu to learning the art of writing efficient T-SQL code in modern SQL Server versions as well as the Azure SQL Database. The book will get you started with query processing fundamentals to help you write powerful, performant T-SQL queries. You will then focus on query execution plans and leverage them for troubleshooting. In later chapters, you will explain how to identify various T-SQL patterns and anti-patterns. This will help you analyze execution plans to gain insights into current performance, and determine whether or not a query is scalable. You will also build diagnostic queries using dynamic management views (DMVs) and dynamic management functions (DMFs) to address various challenges in T-SQL execution. Next, you will work with the built-in tools of SQL Server to shorten the time taken to address query performance and scalability issues. In the concluding chapters, this will guide you through implementing various features, such as Extended Events, Query Store, and Query Tuning Assistant, using hands-on examples. By the end of the book, you will have developed the skills to determine query performance bottlenecks, avoid pitfalls, and discover the anti-patterns in use.
Table of Contents (18 chapters)
Free Chapter
1
Section 1: Query Processing Fundamentals
5
Section 2: Dos and Donts of T-SQL
10
Section 3: Assemble Your Query Troubleshooting Toolbox

Summary

This chapter covered the important topic of upgrading the database compatibility to leverage the latest CE while minimizing the inherent risks that are commonly associated with this upgrade.

From the set of regressed workloads the SQL Server team has handled over the years, the initial scenarios covered by QTA are some of the most common after a database compatibility level upgrade (and, therefore, a CE upgrade) that can make users question whether to upgrade. But that is just because when upgrading from an old version, such as SQL Server 2005 or 2008, our T-SQL queries were fully tuned to the only CE model set that existed at the time. When some aspects of CE changed, there was a possibility that some queries would have to be tuned for the new models. Fortunately, the SQL Server team believes that backward compatibility is an asset in the database engine and included...