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 »

Next week, on Thursday Feb 26th Aaron Buma and I, as part of the Free SQL Training, will be presenting on the use of the MERGE Statement and how to do Recursive Queries. This is intended to help prepare TSQL Developers for the 70-461 certification exam. Here is the basic abstract for the presentation: This will be a free training …

Next Week’s Free SQL Training: MERGE Statement and Recursive Queries 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 »

The free SQL Server Queries weekly training is being presented by Steve Stedman and Aaron Buma. The name of the presentation started out as “OUTPUT Clause and Derived Tables“, however it evolved into “OUTPUT Clause Correlated Subqueries and Subquery Extensions” as we got further into it. Last week we covered some of the basics of Derived Tables or Subqueries, today we will …

Weekly SQL Training – OUTPUT Clause and Derived Tables Read more »

Earlier in the week I added a blog entry on using the OUTPUT Clause on INSERT Statements, today I will expand it by exploring the use of the OUTPUT clause with UPDATE statements. Generally when you do an UPDATE statement you only get a row count returned, you don’t generally get a result set showing what was changed. With the OUTPUT clause …

TSQL OUTPUT Clause With UPDATE Statements Read more »

One of the often overlooked features of SQL Server is the OUTPUT clause, which applies to INSERT, UPDATE, DELETE, and MERGE statements. In this post we are going to go over the basics of using the OUTPUT clause on an INSERT statement. What the output clause does is return a result set on queries that don’t usually return a result …

TSQL OUTPUT Clause on Insert Statements Read more »

On Thursday Feb 19th at 9:00am pacific time, Aaron Buma and I will be doing another FREE SQL query training session. This is a free training provided by Steve Stedman and Aaron Buma to prepare for the Microsoft 70-461 SQL Queries exam. This week we will cover OUTPUT Clause and Derived Tables.  This is provided free of charge to give back …

Next Free SQL Query Training – OUTPUT Clause and Derived Tables Read more »

Here is the agenda for this weeks free SQL training covering  Set Operators, Derived Tables and CTEs – Presentation to prepare for the 70-461 exam: —Set Operators —Derived Tables —Common Table Expressions This session is presented by Aaron Buma and myself. Here is a quick overview of the slides: Set operators – derived tables and CTEs from Steve Stedman This is …

Set Operators, Derived Tables and CTEs – Presentation downloads Read more »

SQL Server – TSQL Analytics Word Search   Find the following words in the word scramble above. TOP RANK DENSE_RANK ROW_NUMBER NTILE OVER LAG LEAD FIRST_VALUE LAST_VALUE PERCENT_RANK PERCENTILE_DISC PERCENTILE_CONT CUME_DIST PARTITION ROWS PRECEDING FOLLOWING UNBOUNDED   Download the Printable PDF of the Word Search. See Also TSQL Queries – Using NTILE TOP, Ranking, NTILE, and Aggregate Functions TSQL Analytics FREE …

SQL Sunday Word Scramble Read more »