Skip to content

Free Copy of Steve Stedman’s CTE Book!

Common table expressions

Improve you query skills with Common Table Expressions.

The Common Table Expression (CTE) is one of the more powerful and often overlooked features in Microsoft SQL Server. This book will show some of the more interesting things you can do with a CTE. You will learn how CTEs are a great alternative to derived table queries, how to do data paging with a CTE and recursive queries with tree path and hierarchical output. This book will also cover how to use the DELETE, UPDATE, and INSERT statements with a CTE, and how to use CTEs in stored procedures and functions.

You will discover what is good and bad with CTEs when it comes to performance and how to avoid performance pitfalls. The twelve chapters take you from the most basic introduction of a CTE all the way to the more complex usage scenarios where a CTE can change the way you look at writing T-SQL queries.

Once you have mastered the CTE you may never look at a query the same again.


With your FREE download you get full access to my Common Table Expressions book, along with sample code to support the queries shown in the book.

You can download this as a PDF and start reading today.

Over 250 pages of content all about TSQL and Common Table Expressions.

  • CHAPTER 1. MEMORY TABLES
  • CHAPTER 2. WHAT IS A COMMON TABLE EXPRESSION?
  • CHAPTER 3. CTES INSTEAD OF DERIVED TABLES
  • CHAPTER 4. RECURSIVE CTES
  • CHAPTER 5. HIERARCHICAL CTES
  • CHAPTER 6. MULTIPLE CTES IN A QUERY
  • CHAPTER 7. DATA PAGING WITH CTES
  • CHAPTER 8. MANIPULATING DATA
  • CHAPTER 9. CTES IN FUNCTIONS, STORED PROCEDURES AND VIEWS
  • CHAPTER 10. COMMON USE CASES
  • CHAPTER 11. CTE PERFORMANCE CONSIDERATIONS
  • CHAPTER 12. CTES FOR GEEKS – CLASSIC RECURSIVE ALGORITHMS

This book was originally written in 2012, and has been updated in 2019 and 2022 for the latest versions of Microsoft SQL Server.


More from Stedman Solutions:

SteveStedman5
Steve and the team at Stedman Solutions are here for all your SQL Server needs.
Contact us today for your free 30 minute consultation..
We are ready to help!

2 thoughts on “Free Copy of Steve Stedman’s CTE Book!”

Leave a Reply

Your email address will not be published. Required fields are marked *