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.

Blogs

Shifting Mindsets: Why FinOps is Essential for Cloud Efficiency

By

As a DevOps practitioner, I’ve always focused on performance, scalability, and automation. But as...

March 2026 SQL Server Security Updates

By

On Patch Tuesday, in addition to OS and Office security patches, Microsoft also released...

How Fabric Mirroring Transformed with SQL Server 2025

By

When mirroring was first released for Azure SQL Database, it used Change Data Capture...

Read the latest Blogs

Forums

Multiple Deployment Processes

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Multiple Deployment Processes

How to Use sqlpackage to Detect Schema Drift Between Azure SQL Databases

By Kunal Rathi

Comments posted to this topic are about the item How to Use sqlpackage to...

Upgrading Admin Queries

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Upgrading Admin Queries

Visit the forum

Question of the Day

Upgrading Admin Queries

I have a query from a former DBA that we run on SQL Server 2025 to check on database metadata. This query references sys.sysaltfiles. I want to refactor this code to be more modern. Which DMV should I reference instead?  

See possible answers