Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 make some rows become 1 row

Author  Topic 

rezakalmas
Starting Member

1 Post

Posted - 2011-05-23 : 09:00:00
hi all. i have some trouble with this transact. i wanna make multiple rows become 1 row. this column's data type are varchar

ex:

id-----------code
12324--------red
12324--------blue
12324--------green
32156--------dark
32156--------light

become:

id----------code
12324-------red,blue,green
32156-------dark,light

i am sorry, my example make you dizzy.but, please help me. thanks before


REZA

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-05-23 : 09:09:26
see
http://www.nigelrivett.net/SQLTsql/CSVStringSQL.html

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -