Who is online?  0 guests and 0 members
Home  »  Blogs  »  BradSchacht: June 2010

Communifire Blogs

Blogs RSS Feed

BradSchacht :June 2010 postings

BradSchacht

Comma Delimited List with COALESCE

6/23/2010 by BradSchacht  -  Comments: 2  -  Views: [7957]

There may be a day when you need to create your own comma delimited list from data contained in a SQL table. Sure you could build a cursor and go through each row adding a comma after each record. The good news is that there is an alternative. The better news is that this method is easier, faster and takes MUCH less code. COALESCE in SQL has many uses and building a list is one of them. To do this in our context use the following format: COALESCE(@Variable + Delimiter , WhatToDoWhenThereAreNoMor...

Read More

Page 1 of 1 (1 items)