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

Have a Plan for Your Personal Downtime

By

Most of us know that spending a lot of time on social media and...

Monday Monitor Tips: Lots of Postgres Options

By

Redgate Monitor is growing to include more than just Microsoft SQL Server monitoring. We...

Advice I Like: Experience and Aptitude

By

Experience is overrated. Most breakthrough accomplishments were done by people doing them for the...

Read the latest Blogs

Forums

why no suggested indexes in estimated exec plan?

By stan

hi im looking at a query for a friend that has to be lacking...

Table Index Size

By Sandir

Comments posted to this topic are about the item Table Index Size

Issues with SQL Server 2022 Server

By alisonwheeler

Hello, At my work place I recently migrated our test environment to SQL Server...

Visit the forum

Question of the Day

Data API Builder APIs

What formats of API endpoints can the Data API Builder present to clients when exposing the database?

See possible answers