sql query to read xml elements from xml file

  • Hi All,

    Iam having the xml as shown below :

    <?xml version="1.0" encoding="UTF-8"?>

    <Page xlink:title="PDU1A-1"

    xlink:role="http://rddl.xmlinside.net/PowerMeasurement/data/ion/presentvalue/dataset/"

    xlink:type="simple"

    ident:namespace="EnterDeviceNamespaceHere"

    ident:name="EnterDeviceNameHere"

    xlink:href="http://192.168.0.32/PDU1A-1.xml" ion:module="Web Page 1">

    <Item v="481.90" l="PDU1A-1 Volt AB" h="23264"/>

    <Item v="485.30" l="PDU1A-1 Volt BC" h="23265"/>

    <Item v="482.60" l="PDU1A-1 Volt CA" h="23266"/>

    <Item v="205.30" l="PDU1A-1 Volt AN" h="23267"/>

    <Item v="205.80" l="PDU1A-1 Volt BN" h="24130"/>

    <Item v="208.10" l="PDU1A-1 Volt CN" h="24131"/>

    </Page>

    </Data>

    From the above xml i need a sql query to read the nodes of xml and the output should be as follows :

    Title Voltage Load Amps

    PDU1A-1481.90PDU1A-1 Volt AB23264

    PDU1A-1 485.30PDU1A-1 Volt BC23265

    PDU1A-1 482.60PDU1A-1 Volt CA23266

    PDU1A-1205.30PDU1A-1 Volt AN23267

    PDU1A-1205.80PDU1A-1 Volt BN24130

    PDU1A-1208.10PDU1A-1 Volt CN24131

    Kindly help me on the same

  • Where is the start tag for DATA?

  • hi,

    thanks for your quick reply, there is no data tag in that xml, kindly ignore that, start and end tags are page

  • This might help:

    read-data-from-xml-file-in-sql-server

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

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

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