SQL LanguageSQL Language discussions not specific to a particular RDBMS program or vendor.

Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .

Hi all,
I'm a beginner in sqlserver2000.
I have a small question.
I have a small table as follows:
company products
------- --------
123 pencil
123 ink
123 fillers
123 cartridge
124 apple
124 orange

The objective is to display company and its products separated by commas.
123 pencil,ink,fillers,cartridge
124 apple,orange

I did it by creating a cursor by storing those two values in two temp variables and going row by row appending the characters. Since cursors are said to be slow, can this be done by select statements? I don't want to create another table for the same data this table has.
thank you for any ideas.
suraj