Using Cursors, followed by Using String Functions

On Thursday March 12th at 9:00am (pacific time), we will be hosting another free training provided by Aaron Buma and I at Emergency Reporting to prepare for the Microsoft 70-461 SQL Queries exam. This week we will be a two part session Using Cursors, followed by Using String Functions. This is provided free of charge to give back to the SQL community.

Here is the outline:

  • Using Cursors
  • Using String Functions

Here is the link to the Google On Air Broadcast where you can watch for free.

This session will be about 90 minutes, Aaron Buma will present about half and I will present the other half. After the broadcast is over, it will be made available on YouTube for replay.

See Also:


SQL Server Cursors Good or Bad

Next week as part of the free SQL Query training that Aaron Buma and I provide, the topic I will be presenting is cursors. How to use them, what they are, everything you ever wanted to know.

My concern in this presentation is that cursors have caused me many headaches in regard to performance over time.

The main problem that I see is that developers who generally think in programming constructs like looping, like to use cursors because it is comfortable, it is more like a WHILE loop iterating through a result set. But SQL Server is designed manage sets of data through joining very quickly, and iterating through a loop generally ends up being much slower that joining. The term RBAR or Row By Agonizing Row describes this slow process.

I am looking for other arguments as to why cursors are good or bad. I know the final answer is always, “It Depends”, but what are some cases that cursors work well, and what are areas that they are horrible? I am looking for some stories here to help provide a good foundation for the weekly training.

Please post your response below.


-Steve Stedman

Today’s Training: SQL Queries Section 1 Review

As part of our weekly free SQL Query Training, we have split the 70-461 curriculum into 4 sections to prepare everyone to take the certification test later in the year. Today’s session is to review the first 25% of the sessions, or the section 1 review as we are calling it.

The review topics we will be covering today are the following:

Here is the download file for this week with all the TSQL query examples included.

Section 1

Next Weekly Free SQL Training: A Review

We are currently about 25% of the way through the SQL Server 70-461 exam preparation class, which has been available through Google On Air Broadcasts every Thursday at 9:00am Pacific time.

To celebrate the 25% mark, and to strengthen the training we have decided to do a review session on everything that we have covered so far.

You can watch via Google On Air Broadcasts at this url:

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:

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: