This book and its prequel—Inside Microsoft SQL Server 2008: T-SQL Querying—cover advanced T-SQL querying, query tuning, and programming in Microsoft SQL Server 2008. They are designed for experienced programmers and DBAs who need to write and optimize code in SQL Server 2008. For brevity, I’ll refer to the books as T-SQL Querying and T-SQL Programming, or just as these books.
Those who read the SQL Server 2005 edition of the books will find plenty of new material covering new subjects, new features, and enhancements in SQL Server 2008, plus revisions and new insights about the existing subjects.
These books focus on practical common problems, discussing several approaches to tackle each. You will be introduced to many polished techniques that will enhance your toolbox and coding vocabulary, allowing you to provide efficient solutions in a natural manner.
These books unveil the power of set-based querying, and they explain why it’s usually superior to procedural programming with cursors and the like. At the same time, they teach you how to identify the few scenarios where cursor-based solutions are superior to set-based ones.
The prequel to this book—T-SQL Querying—focuses on set-based querying and query tuning, and I recommend that you read it first. This book—T-SQL Programming—focuses on procedural programming and assumes that you read the first book or have sufficient querying background.
T-SQL Querying starts with five chapters that lay the foundation of logical and physical query processing required to gain the most from the rest of the chapters in both books.
The first chapter covers logical query processing. It describes in detail the logical phases involved in processing queries, the unique aspects of SQL querying, and the special mind-set you need to adopt to program in a relational, set-oriented environment.
The second chapter covers set theory and predicate logic—the strong mathematical foundations upon which the relational model is built. Understanding these foundations will give you better insights into the model and the language. This chapter was written by Steve Kass, who was also the main technical editor of these books. Steve has a unique combination of strengths in mathematics, computer science, SQL, and English that make him the ideal author for this subject.