how to create a table from the given string with row separator as "," and column separator as "|".

  • Hi Friends,

    how to create a table from the given string with row separator as "," and column separator as "|".

    For Eg.:

    @array varchar(max),

    @RowDelim varchar(10),

    @ColDelim varchar(10)

    I will pass the values to the above parameters from the frontend in this way:

    @array = 'a12,b23,c34|d,45e56,f67|g78,h89,i90'

    @RowDelim = '|'

    @ColDelim = ','

    and i need the output to be returning a table as :

    -----------------

    Col1 Col2 Col3

    -----------------

    a12 b23 c34

    d45 e56 f67

    g78 h89 i90

    -----------------

    i can t pass XML. I need to pass on String to the SP.

    Thanks

    Aditya

  • Did you read this ? http://www.sqlservercentral.com/articles/T-SQL/63003/

    It tells you all you need to know.

    Are you having trouble with it ? If so what is unclear ?



    Clear Sky SQL
    My Blog[/url]

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

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