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

Familiar Sights

By

Yesterday was a long day in London. I arrived late in the am, and...

Derby City Data Days

By

It was awesome to see the Kentucky data community come out for the first...

Tomorrow: Webcast on SQL Server security

By

Tomorrow, April 16, 2024, I will be giving another webcast; this one will be...

Read the latest Blogs

Forums

Difference between equal directly and use SUBSTRING

By Martass

Hello, I have a script that was running really long, and I have found...

Visualisation options as an alternative to SanKey diagram

By aaron.reese

I am building a report to show customer journeys and their arrears levels. I...

should i prefer join or left join over exists or in

By rajemessage 14195

hi, I have seen people use exists when exists is required and no cols...

Visit the forum

Question of the Day

Express In-Memory OLTP

Can I create In-Memory OLTP tables in SQL Server Express?

See possible answers