Recursive CTE Examples
Transcription of Video: One of the things I like play with is performance and pushing things to their limits. So what I want to do next is see how far can we push this sum of parts? Can we do …
Notes from SQL Server Classes
Transcription of Video: One of the things I like play with is performance and pushing things to their limits. So what I want to do next is see how far can we push this sum of parts? Can we do …
Transcription of Video: So here’s an example of building a recursive common table expression, I’m gonna start out with the with statement, we’re gonna call it department CTE. And we’re going to label the columns that we’re going to return …
Transcription of Video: Now on to recursive common table expressions. This is my favorite part. And this is where it gets really fun is working with recursive CTE’s. Because with recursive CTE, we’re doing things that are really difficult to …
Steve’s Introduction to Recursive Common Table Expressions Read more »
Transcription of Video: Every recursive CTE needs an anchor query. And what an anchor query is, is it defines the start of the recursion. This is the part that cannot reference the CTE itself, it has to start with some …
Transcription of Video: Now on to CTE’s in stored procedures, functions and views. When I first started doing this presentation several years ago, people would ask, “oh, can the CTE be used in a function or can be used in …
Transcription of Video: Here’s an example of a CTE that’s been created for data paging, where the select statement inside of the CTE that shown in blue is just grabbing some table names and column names from the SIS dot …
Video transcription: Basically, what data Paging is, is when you’ve got a large large result set and what you want to do is display like the top 20, or top 50 results. So if you go to any search engine …
If you have multiple CTE’s in a query then you can do what’s called a nested CTE. This is what Steve will go over in this video. Transcription of Video: So next, if you’ve got multiple CTE’s, we can do …
Added to SQL Server in 2008 Steve explains and demonstrates how to set up row constructor. Transcription of video: So there’s this thing called a row constructor. And this was added in SQL 2008. But it’s a way of saying …
Row Constructor in SQL Server Demo and Explanation Read more »
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 …