-
Course
- Data
SQL Server: Transact-SQL Common Table Expressions
Learn how to create and use common table expressions (CTEs) correctly, for developers and DBAs from SQL Server 2005 onward
What you'll learn
Common table expressions are a useful and versatile T-SQL query construct and this demo-centric course shows how to correctly define and use CTEs, what restrictions there are for using them, and some common usage scenarios. This course is perfect for developers, DBAs, and anyone responsible for writing Transact-SQL code, from complete beginners through to those with more experience. The information in the course applies to all versions from SQL Server 2005 onward.
Table of contents
- Module Introduction | 43s
- What are CTEs and Why Use Them? | 1m
- CTE Syntax | 1m 10s
- Demo: Non-Recursive CTE Example | 3m 4s
- Demo: Semicolon Requirements | 1m 7s
- Demo: When Column Names Must Be Specified | 1m 50s
- Demo: Execution Scope | 2m 30s
- Demo: Multiple CTE Query Definitions | 1m 22s
- Demo: Defining and Referencing Multiple CTEs | 1m 24s
- Demo: Multiple References To the Same CTE | 3m 2s
- Demo: CTEs with Data Modification Statements | 2m 25s
- Demo: CTEs and Views | 1m 10s
- Demo: CTEs and Stored Procedures | 55s
- Demo: CTEs and Triggers | 1m 37s
- Demo: CTEs and User-Defined Functions | 3m 5s
- Demo: Recursive CTE Example | 3m 43s
- Module Summary | 21s
About the author
Joe Sack is a Principal Program Manager in the SQL Server and Azure SQL Database product team at Microsoft, with a focus on query processing. With over 19 years of experience in the industry, Joe is an author and speaker, specializing in performance tuning and optimization.
More Courses by Joe