Home Forums Programming XML Converting table data into Table columns + <xmlformat> in last column RE: Converting table data into Table columns + <xmlformat> in last column

  • Vijay_Raju (10/2/2012)


    Let me explain my requirement in detail.

    I have a table A with 20 rows. I need to supply the data for my down stream system in a format of a table B with 13 rows . first 12 rows of Table A and Table B are same. I need to populate the 13th column of table B in xml format ( with 13-20 rows in table A)

    That isn't exactly what I would call explaining it in detail. I can't see what you see from here and I have no knowledge of your project, data or requirements.

    I suggested previously you read the article in my signature. It seems you did not. I can't even begin to help you because I don't have anything to work with. I don't know what the source table and data look like and I don't know what you want for output. If you can post ddl (create table statements), sample data (insert statements) along with the desired output based on your sample data this is probably fairly straight forward.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/