querying xml

  • Hi All,

    From the below shown xml, i nead the sql query to show the output as below:

    DECLARE @data XML = '

    <Data xmlns:ident="http://rddl.xmlinside.net/PowerMeasurement/data/ion/identity/1/"

    xmlns:ion="http://rddl.xmlinside.net/PowerMeasurement/data/ion/presentvalue/1/"

    xmlns:xlink="http://www.w3.org/1999/xlink"

    xmlns="http://rddl.xmlinside.net/PowerMeasurement/data/ion/presentvalue/1/">

    <ident:GeneratedBy

    ident:dateTime="2012-04-24T08:12:31.385-08:00"

    ident:signature="SI-1105B245-02"

    ident:type="9510RTU"

    ident:namespace="EnterDeviceNamespaceHere"

    ident:name="EnterDeviceNameHere"/>

    <ident:Configuration ident:tag2=""

    ident:tag1="" ident:owner=""

    ident:template=""

    ident:revision="9510RTUV365">

    <ident:Timezone>

    <ident:Bias>480</ident:Bias>

    <ident:DSTBias>-60</ident:DSTBias>

    <ident:DSTStart>2012-03-11T02:00:00.000-08:00</ident:DSTStart>

    <ident:DSTEnd>2012-11-04T02:00:00.000-08:00</ident:DSTEnd>

    <ident:DSTStart>2013-03-10T02:00:00.000-08:00</ident:DSTStart>

    <ident:DSTEnd>2013-11-03T02:00:00.000-08:00</ident:DSTEnd>

    </ident:Timezone>

    </ident:Configuration>

    <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"/>

    </Page>

    </Data>

    '

    Output :

    PDU1A-1 Volt AB PDU1A-1 Volt BC

    481.90 485.30

    Kindly help me on the same

  • This will help you :

    Loading XML Data into SQL Server (SQL Spackle)[/url]

    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 2 posts - 1 through 2 (of 2 total)

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