Stairway to Advanced T-SQL

Stairway to Advanced T-SQL Level 4: Record Level Processing Using Transact-SQL Cursors

Using a CURSOR is not normally the best way to process through a set of records. Yet when a seasoned programmer moves to writing TSQL for the first time they frequently look for ways to process a sets of records one row at a time. They do this because they are not used to thinking about processing records as a set. In order to process through a TSQL record set a row at a time you can use a cursor. A cursor is a record set that is defined with the DECLARE CURSOR statement. Cursors can be defined as either read-only or updatable. In this article I will introduce you to using cursors to do record level processing one row at a time.

External Article

Have your say about PASS Summit 2021

Redgate has committed to organizing a free virtual Summit for the PASS Community this fall. To help guide the format and provide you and the data platform community with the best virtual event experience possible, we'd appreciate your input. As a thank you for your feedback you could win a Peloton Bike or $3,000 (the equivalent in your local currency) to donate to your chosen charity.

Blogs

Denver Dev Day Oct 2024 Slides

By

Here are the slides from my talk today: CI in Azure DevOps If you...

Should I Learn PostgreSQL

By

I got asked this question recently: I constantly see PostgreSQL on Microsoft slides, email,...

A New Word: Hickering

By

hickering – n.  the habit of falling hard for whatever pretty new acquaintance happens...

Read the latest Blogs

Forums

test new topic

By philip.scott

posting a new topic

New article

By Steve Jones - SSC Editor

Comments posted to this topic are about the item New article

Monitoring Azure Blob Storage

By arindamxs

Comments posted to this topic are about the item Monitoring Azure Blob Storage

Visit the forum

Question of the Day

Azure Data Lake Storage Gen 2

Azure Data Lake Storage Gen 2 is built on ...?

See possible answers