Returning row based data from XML

  • Hi All,

    I have a data something like below...

    <Fields>

    <Field Name="String 1" />

    <Field Name="String 2" />

    <Field Name="String 3" />

    </Fields>

    What I am looking I should get the data in row based format.

    Strings

    String 1

    String 2

    String 3

    Abhijit - http://abhijitmore.wordpress.com

  • Pretty simple to do with SQL XQuery. Are you familiar with that?

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • yes .. but want to know is there is any other way w/o using xquery.

    Abhijit - http://abhijitmore.wordpress.com

  • Lots of ways. You could pass it to a CLR DLL via a CLR proc, and have one of the .NET languages shred it for you. You could write a complex string function that would parse the value out of it for you. You could use the older XML procs from SQL 2000. None of these will be as easy or efficient as XQuery, but they'll all work.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

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

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