Cursors

External Article

Working with SQL Cursors

  • Article

n SQL cursors serve as a pointer that enables application programming language to deal with query results one row at a time. Read on to explores the concept behind and learn how to declare cursors, open, retrieve data from them, and then close them.

2020-06-09

Stairway to Advanced T-SQL

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

  • Stairway Step

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.

4 (1)

You rated this post out of 5. Change rating

2021-04-14 (first published: )

11,499 reads

SQLServerCentral Article

Cursor-Killing: Retrieving Recently Modified Data

  • Article

Cursors are considered by many to be the bane of good T-SQL. What are the best ways to avoid iterative T-SQL and to write queries that look and perform beautifully? In the next part of an ongoing series, we look at ways to efficiently retrieve recently modified data.

4.88 (42)

You rated this post out of 5. Change rating

2014-06-02

6,773 reads

SQLServerCentral Article

Cursor-Killing: Accessing Data in the Next Row

  • Article

Cursors are considered by many to be the bane of good T-SQL. What are the best ways to avoid iterative T-SQL and to write queries that look and perform beautifully? This first part in an ongoing series of cursor-killing handles inter-row analysis.

4.86 (94)

You rated this post out of 5. Change rating

2015-12-18 (first published: )

22,496 reads

Blogs

Set a Runtime Variable in an Azure DevOps Pipeline

By

Note: I DO NOT recommend this. Any changes to a pipeline should be in...

A New Word: Symptomania

By

symptomania – n. the fantasy that there’s some elaborate diagnosis out there that neatly...

Query Store Keeps Switching Itself Off, Getting it Moving Again

By

I recently received a complaint that Query Store for a particular database was turned...

Read the latest Blogs

Forums

7 sept, scheduled book

By philip.scott

Comments posted to this topic are about the item 7 sept, scheduled book

7 sept, schedlued article

By philip.scott

Comments posted to this topic are about the item 7 sept, schedlued article

6 sept, published book

By philip.scott

Comments posted to this topic are about the item 6 sept, published book

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