Home Forums SQL Server 7,2000 T-SQL Csv list in column to separate columns RE: Csv list in column to separate columns

  • Jeff Moden (9/17/2012)


    Eliza (9/17/2012)


    Hi all,

    Can I ask please if I have a row and one column has a csv list in it. Is there a way please to split the csv list into columns in a row?

    For example if I have

    1 - Apple, Pear, Orange

    2. - Pear, Apple, Bananna

    In my output I would like

    Col1. Col2. Col3

    1 Apple__Pear____Orange.

    2 Pear___Apple___Bananna

    Sorry underscores are meant to split the columns.

    Thank you

    Eliza

    Are the number of elements in each CSV fixed or variable with in the same column?

    The number can vary, however it will be between 0 (null value) and a maximum of 25. It won't go higher than 25.