Weekly SQL Training – MERGE Statement and Recursive Queries

The free SQL Server Queries weekly training is being presented by Emergency Reporting. The training is being presented by Aaron Buma and myself. This week we are covering two topics, first the MERGE statement will be covered by Aaron, then I will present on Recursive Queries. There MERGE statement is one of those that I was not familiar enough with when I took the certification exam 2 years ago. The recursive queries section was touched on a bit during the CTE presentation, here I will go into much more detail with additional samples.

You can download the slides and TSQL sample code here:
MERGE-Statement-and-Recursive-Queries.zip

Here are the slides, located at slideshare:

And here is the video on my YouTube Channel:

 

This is a live broadcast that was available on Google On Air Broadcasts.

See Also:

Using a Common Table Expression Instead of a Derived Table

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:

What is a Common Table Expression

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 CTE Related Posts:

SQL Query Training – Next Week – Set Operators, Derived Tables and CTEs

The SQL Training was a lot of fun this week we covered Top, Ranking, NTILE, and Analytic functions in preparation for the Microsoft 70-461 exam.

Next week Aaron Buma and I will be presenting Set Operators, Derived Tables and CTEs. The live session will be with Google On Air Broadcasts Thursday Feb 12th at 9:00am (pacific). This is a FREE SQL Training available to anyone who would like to attend.

This one will be even more fun for me, as I will be presenting on CTEs. CTE stands for Common Table Expression which is a way to have a temporary result set similar to a subquery or derived table in SQL Server.  I have spent a great deal of time studying CTEs over the last several years, and in 2013 I published a book on Common Table Expressions.

 

The CTE part of the presentation will include the following:

  • Introduction to Memory Tables and CTEs
  • Simple CTE
  • CTE Instead of a Derived Table
  • Multiple CTE in a Query
  • Data Paging
  • CTEs in Stored Procedures, Functions and Views
  • Introduction To Recursive CTEs

CTE Related Posts:

 

Common Table Expressions Book

If you enjoyed this posting, and want to learn more about common table expressions, please take a look at my book on CTE’s at Amazon.com. The book is titled Common Table Expressions – Joes 2 Pros® – A CTE Tutorial on Performance, Stored Procedures, Recursion, Nesting and the use of Multiple CTEs.

Advanced CTEs Slides and Sample Queries

My second presentation at SQL Saturday in Portland Oregon is Advanced Common Table Expressions.

Here is the outline for the session.

1. Hierarchical Recursive CTEs
2. Manipulating Data
3. Common Use Cases
4. CTE Performance Considerations

Download the presentation and samples here:  Advanced CTEs.zip

See Also:

Introduction to CTEs presentation

Introduction to CTEs Slides and Sample Queries

Today I am at SQL Saturday Portland Oregon, and at 9:00am I am presenting the Introduction To Common Table Expressions session:

Introduction

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 temporary views, and to use the result set multiple times in the same query. Learn how simplify query syntax using CTE’s. One of the most overlooked features of SQL Server is the CTE which not only simplifies the query, but gives you the ability to do things that would otherwise be impossible (or at least very challenging) with SQL Server. The class is designed for people who haven’t used CTE’s before, or for those who want to learn the basics of CTEs including data paging. This session pairs well with the Advanced Common Table Expressions session.

This session will include the following topics:

  • Introduction to Memory Tables and CTEs
  • Simple CTE
  • CTE Instead of a Derived Table
  • Multiple CTE in a Query
  • Data Paging
  • CTEs in Stored Procedures, Functions and Views
  • Introduction To Recursive CTEs

At 10:45 I will be giving the Advanced Common Table Expressions Session.

Download the presentation here:  Introduction to CTEs.zip

Related Posts: