Convert XML to table without using sp_xml_preparedocument

  • Hi Friends,

    I just want to know if there is an alternative to convert a normal XML into table or result set without using OPEN XML or sp_xml_preparedocument.

    I have a normal xml as below

    DECLARE @VChr1 XML = '<i>1</i><i>52</i><i>3</i>'

    I want it to be convert in a resultset like

    ReturnValues

    1

    52

    3

    Please help and thanks in advance.

  • I'd prefer using XQuery rather than OPENXML.

    Something like

    DECLARE @VChr1 XML

    SET @VChr1 = '<i>1</i><i>52</i><i>3</i>' -- had to do it in two steps due to SS2K5

    SELECT

    T.c.value('./text()[1]','int') val

    FROM @VChr1.nodes('i') T(c)



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • Hi friends,

    I'm newbie in this forum. Anyone can give me any suggestion of open source tools to convert database from .sql to .CSV? I also try to find how to convert the comma delimiter of sql to colon delimiter? but i want to use open source software to do this. 🙂 . anyone can give me the idea?:-)

  • moonbrig (3/8/2010)


    Hi friends,

    I'm newbie in this forum. Anyone can give me any suggestion of open source tools to convert database from .sql to .CSV? I also try to find how to convert the comma delimiter of sql to colon delimiter? but i want to use open source software to do this. 🙂 . anyone can give me the idea?:-)

    Please open a new thread and don't "hijack" another one that's on a totally different subject.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

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

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