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

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...

A New Word: the Wends

By

the wends– n. the frustration that you’re not enjoying an experience as much as...

Read the latest Blogs

Forums

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...

Should I create tables with dynamic SQL?

By mjdemaris

Hello all, I am thinking of creating a "shopping cart" in our application.  My...

Expression Error ( property 'Error' cannot be selected )

By rjdineen

Hello there. I have the following Pipeline I want to get the property error...

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