help on xml schema

  • You need to include the namespace declaration in your SELECt statement.

    Assuminig you're using SS2K5 or SS2K8, here's the XQuery snippet I would use:

    declare @xml xml

    set @xml='<HousingLoan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

    <MemberData>

    <Name>alan</Name>

    </MemberData>

    <FinanciarData>

    <Source>Bank</Source>

    </FinanciarData>

    </HousingLoan>'

    ;

    WITH XMLNAMESPACES

    ('http://www.w3.org/2001/XMLSchema-instance' as xsi,

    'http://www.w3.org/2001/XMLSchema' as xsd

    )

    SELECT

    c.value('Source[1]','VARCHAR(10)') as source

    FROM

    @xml.nodes('HousingLoan/FinanciarData') 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]

Viewing post 1 (of 2 total)

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