Last week I had the great opportunity to speak at PASS Summit 2015. My presentation was on Common Table Expressions.   Here is the sample code from the presentation. AdvancedCTEs.zip   Related Links: Common Table Expression (CTE) Month at SteveStedman.com (introduction) Sample Database for Common Table Expressions Writing Your First Common Table Expression with SQL Server Video: Writing Your First CTE …

Epic Life Goal Completed: Speaking at PASS Summit – Advanced CTEs Read more »

Here is a short video that shows how to convert those ugly derived table (SubQuery) queries into a common table expression to help clean up your TSQL code. This applies to Common Table Expressions on Microsoft SQL Server, and the recording comes from my Free SQL Query Training course.     Other CTE Related Posts: Writing Your First Common Table Expression …

Using a Common Table Expression Instead of a Derived Table Read more »

I just a added a video to YouTube titled “What is a Common Table Expression”.  This video covers the extreme basics of what a CTE is on Microsoft SQL Server, and how to write that CTE in TSQL. Here is the video: It’s a very short video with the basics of what a CTE is.  Take a look.   Other …

What is a Common Table Expression Read more »

Today I am at SQL Saturday Portland Oregon, and at 9:00am I am presenting the Introduction To Common Table Expressions session: Here is the abstract: Have you ever wanted to create a recursive query, but didn’t see how to do it. With the Common Table Expressions session you will learn everything needed to start using CTE’s for recursive queries, as …

Introduction to CTEs Slides and Sample Queries Read more »

In my Common Table Expressions presentation the topic of recursion often comes up, but for scalar functions in T-SQL, it might not be as common. This article has been written to show how a scalar function in SQL Server can call itself, thus being considered recursive. The example uses a recursive scalar function to calculate the Fibonacci sequence. What is …

Recursive Scalar Function in T-SQL Read more »

The article could be named, “How to use up all of your SQL Server available memory with a single CTE query.”  Another name for the article could just be “SQL Server Bug Report” depending on how you look at it. When presenting unleashing Common Table Expressions at SQL Saturday a while back, I was asked a couple of great questions …

SQL Server Memory Hog Query Read more »

Its going to be a great day!   Ready for SQL Saturday 172 in Portland today, looking forward learning lots, and sharing my CTE Presentation with those who want to learn about Common Table Expressions. Please come to my CTE if you are interested in any of the following: 1.What is a Common Table Expression 2.Simple CTE 3.CTE – Subquery …

SQL Saturday #172 in Portland Oregon Read more »

Here are a few links to some of the other CTE examples used during my Common Table Expressions presentation. Using a CTE in a Function to Split Up a Query String Using a CTE to Split a String Into Rows Can we use CTEs use in SSRS? CTE Hierarchy compared to the alternative Calculating Factorials with a Recursive CTE CTE …

Common Table Expression – links Read more »

Today I started the day early with a great presentation for the SQL Lunch UK group on Common Table Expressions. For those who attended the presentation here is the Zip file with the Powerpoint and the SQL code from the demo.  Feel free to download it and learn from it. CTE_SQL_LUNCH_UK_May_2012.zip   Here are a few links to some of …

SQL Lunch UK Read more »