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

A New Word: Anderance

By

anderance – n. the awareness that your partner perceives the relationship from a totally...

Troubleshooting SQL Server – Starting with the Error Log

By

We’ve all been there. Someone walks up and asks, “Is SQL Server having issues?”...

From OLTP to Analytics: Bridging the Gap with Modern SQL Architectures

By

In the beginning, there was OLTP – Online Transaction Processing. Fast, reliable, and ruthlessly...

Read the latest Blogs

Forums

The Yutes

By Grant Fritchey

Comments posted to this topic are about the item The Yutes

Work out closing balance using opening balance of prior month

By Bhagat

Hello, I think I need a recursive cte query but unsure of the logic....

The Security of Old Tech

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The Security of Old Tech

Visit the forum

Question of the Day

Tables with a SPARSE Column and Consumption

True or False:  Tables with a SPARSE column consume more space than regular columns if most values are NOT NULL.

See possible answers