Row to Column Conversion

  • Hi All,

    I have a requirement in sql server 2005 reporting services where I need multiple selection. But my database is in Sqlserver 2000.

    If the input is as follows:

    declare @input varchar (8000)

    @input = 'east,west,north,south'

    I would like to get my output in column shown below.

    east

    west

    north

    south

    Can anybody help me how to do this in sql server 2000 as I will not be able to use tsplit or xml function.

    Thanks.

  • roy.neelanjana (9/27/2009)


    Hi All,

    I have a requirement in sql server 2005 reporting services where I need multiple selection. But my database is in Sqlserver 2000.

    If the input is as follows:

    declare @input varchar (8000)

    @input = 'east,west,north,south'

    I would like to get my output in column shown below.

    east

    west

    north

    south

    Can anybody help me how to do this in sql server 2000 as I will not be able to use tsplit or xml function.

    Thanks.

    Teach a man to fish... please read the article at the following link.

    http://qa.sqlservercentral.com/articles/T-SQL/62867/

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.
    "Change is inevitable... change for the better is not".

    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)
    Intro to Tally Tables and Functions

  • Heh... I wonder if he learned to fish... or drowned. 😛

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.
    "Change is inevitable... change for the better is not".

    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)
    Intro to Tally Tables and Functions

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply