p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > SQL Server > SQL Server ASP
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 18th, 2008, 03:15 AM
Registered User
 
Join Date: Jul 2008
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Concatenate multiple records into one

Hi,

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old August 19th, 2008, 03:57 PM
Friend of Wrox
Points: 4,805, Level: 29
Points: 4,805, Level: 29 Points: 4,805, Level: 29 Points: 4,805, Level: 29
Activity: 50%
Activity: 50% Activity: 50% Activity: 50%
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,323
Thanks: 3
Thanked 70 Times in 69 Posts
Default

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.

Anyway:

This is a very general answer:
http://www.devcow.com/blogs/adnrg/ar...le-record.aspx

But if you only have a single ID value then you can do it more simply:
http://www.sqlteam.com/article/using...limited-string
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

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



All times are GMT -4. The time now is 12:46 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc