Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server ASP
SQL Server ASP Discussions about ASP programming with Microsoft's SQL Server. For more ASP forums, see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server ASP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 18th, 2008, 02:15 AM
Registered User
Join Date: Jul 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Concatenate multiple records into one


I want to concatenate multiple records of a column in a single field.like
I have data
num id
123 1
456 1
765 1

i want to make a new table from this as
number id
123,456,765 1

can anyone help me in this?

I m using ASP & SQL server

Old August 19th, 2008, 02:57 PM
Friend of Wrox
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts

Please don't do this!

Make a query to produce a *RESULT* like that, yes. But please don't create a new table like that. You will lose the ability to make many kinds of good queries when you store data in a concatenated list like that.


This is a very general answer:

But if you only have a single ID value then you can do it more simply:

Similar Threads
Thread Thread Starter Forum Replies Last Post
multiple records in database svk SQL Language 1 May 18th, 2008 03:59 AM
concatenate records davehodges Access 5 November 1st, 2007 10:13 AM
URGENT : Concatenate multiple records from table cool_rk SQL Language 2 October 7th, 2004 11:04 PM
Multiple records!!!! vmclear04 Classic ASP Databases 1 August 24th, 2004 04:53 AM
Concatenate multiple records from table to single Ron Howerton SQL Language 6 August 23rd, 2004 08:49 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.