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

Advice I Like: Rewards from Work

By

The greatest rewards come from working on something that nobody has words for. If...

Overcoming Challenges: Navigating Common Pitfalls in FinOps Adoption

By

Working in DevOps, I’ve seen FinOps do amazing things for cloud cost control, but...

Why your data still can’t answer a simple question 

By

Every organization I talk to has the same problem dressed up in different clothes....

Read the latest Blogs

Forums

The day-to-day pressures of a DBA team, and how we can work smarter with automation and AI

By Terry Jago

Comments posted to this topic are about the item The day-to-day pressures of a...

Creating a Simple and Flexible Random Password Generator in SQL Server

By john.martin

Comments posted to this topic are about the item Creating a Simple and Flexible...

SQL Art, Part 3: Happy Easter Fun in SSMS

By Terry Jago

Comments posted to this topic are about the item SQL Art, Part 3: Happy...

Visit the forum

Question of the Day

Identities and Sequences IV

When thinking about the identity property and sequence objects, which of these can be used with numeric and decimal data types?

See possible answers