Technical Article

Concatenating Multiple Row Values into a Single Comma-Separated List

In scenarios where you need to consolidate multiple rows into a single, comma-separated value, you can achieve this using FOR XML PATH. This script demonstrates how to retrieve volunteer data and display the days they have selected for participation.

You rated this post out of 5. Change rating

2024-11-11 (first published: )

1,412 reads

Technical Article

While Loop in T-SQL

Often, we encounter situations where we need to loop through a dataset to process or update records iteratively. In such cases, I use WHILE loop like below. The example below demonstrates how a WHILE loop can be used to iterate Sales records. This approach is particularly effective when working with a numerical or date column, […]

(2)

You rated this post out of 5. Change rating

2024-10-15

555 reads

Blogs

Rolling Back a Broken Release

By

We had an interesting discussion about deployments in databases and how you go forward...

A bespoke reporting solution doesn’t have to cost the earth

By

You could be tolerating limited reporting because there isn’t an off the shelf solution...

Presenting with Visual Studio Code

By

A while back I wrote a quick post on setting up key mappings in...

Read the latest Blogs

Forums

Remotely Engineer Fabric Lakehouse objects: The Fabric Modern Data Platform

By John Miner

Comments posted to this topic are about the item Remotely Engineer Fabric Lakehouse objects:...

Creating JSON III

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Creating JSON III

Testing is Becoming More Important

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Testing is Becoming More Important

Visit the forum

Question of the Day

Creating JSON III

In a SQL Server 2025 table, called Beer, I have this data:

BeerIDBeerName
1Becks
2Fat Tire
3Mac n Jacks
4Alaskan Amber
8Kirin
I run this code:
SELECT JSON_OBJECTAGG(
    BeerID: BeerName )
FROM beer;
What are the results?

See possible answers