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.

SQLServerCentral Editorial

To Each Their Own

I recently came back from a trip to Las Vegas. I was privileged to be able to take part in the very first Fabric Community Conference. It was a great event, well attended. BUT... It was in Las Vegas. I am not a fan. First of all, Vegas is just far too noisy for me. […]

Blogs

5 Starter Projects for Your AI and Data Engineering Portfolio

By

Reading tutorials is fine. Shipping something is better. If you are trying to break...

The Book of Redgate: Taking Breaks

By

We work hard at Redgate, though with a good work-life balance. One interesting observation...

Database AI Agents: The Read-Only Rule

By

Fourth in a series on Ai and databases. What Read-Only Advisory Actually Means A...

Read the latest Blogs

Forums

Displaying Money

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Displaying Money

The Slow Growing Problems

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The Slow Growing Problems

Calculating the Harmonic Mean in Power BI

By Dinesh Asanka

Comments posted to this topic are about the item Calculating the Harmonic Mean in...

Visit the forum

Question of the Day

Displaying Money

I want to get the currency sign displayed with my amount stored in a money type. Does this work?

DECLARE @Amount MONEY;
SET @Amount = '?1500';

SELECT CAST( @Amount  AS VARCHAR(30)) AS Euros

See possible answers