XML data extraction

  • Dear All,

    I am new for SQL XML programming

    I want to extract data from SQL tables to XML file in the E2B standards.

    the source will be the number of tables with selected columns and out put should be XML file.

    How can we do this in SQL server 2005 Enterprise Edition with 32 bit.

    Your sharing will be highly appreciable.

    The XML format will be like below.

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

    <!DOCTYPE ichicsr (View Source for full doctype...)>

    - <ichicsr lang="en">

    - <ichicsrmessageheader>

    <messagetype>ichicsr</messagetype>

    <messageformatversion>2.1</messageformatversion>

    <messageformatrelease>2.0</messageformatrelease>

    <messagenumb>56530_PRD</messagenumb>

    <messagesenderidentifier>MPIGALT</messagesenderidentifier>

    <messagereceiveridentifier>GALTJNJPRD</messagereceiveridentifier>

    <messagedateformat>204</messagedateformat>

    <messagedate>20100907112552</messagedate>

    </ichicsrmessageheader>

    - <safetyreport>

    <safetyreportversion>3</safetyreportversion>

    <safetyreportid>ES-MPIJNJ-2007_02502</safetyreportid>

    <primarysourcecountry>ES</primarysourcecountry>

    <occurcountry>ES</occurcountry>

    <transmissiondateformat>102</transmissiondateformat>

    <transmissiondate>20100903</transmissiondate>

    <reporttype>3</reporttype>

    <serious>1</serious>

    <seriousnessdeath>2</seriousnessdeath>

    <seriousnesslifethreatening>2</seriousnesslifethreatening>

    <seriousnesshospitalization>2</seriousnesshospitalization>

    <seriousnessdisabling>2</seriousnessdisabling>

    <seriousnesscongenitalanomali>2</seriousnesscongenitalanomali>

    <seriousnessother>1</seriousnessother>

    <receivedateformat>102</receivedateformat>

    <receivedate>20070719</receivedate>

    <receiptdateformat>102</receiptdateformat>

    <receiptdate>20100903</receiptdate>

    <additionaldocument>2</additionaldocument>

    <fulfillexpeditecriteria>1</fulfillexpeditecriteria>

    <companynumb>eee</companynumb>

    <duplicate>1</duplicate>

    <medicallyconfirm>1</medicallyconfirm>

    - <summary>

    <narrativeincludeclinical>xxxxxxx.</narrativeincludeclinical>

    <reportercomment />

    <senderdiagnosismeddraversion>13.0</senderdiagnosismeddraversion>

    <senderdiagnosis>10028651</senderdiagnosis>

    </summary>

    </patient>

    </safetyreport>

    </ichicsr>

    Thanks,

    Gangadhar

  • As I repeatedly have told you here http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=152250

    We don't know what your tables are named, what information is stored where and so on.

    Also, we have no idea of foreign keys, relations and logical storage decisions.


    N 56°04'39.16"
    E 12°55'05.25"

  • Search either BOL or the web for "FOR XML EXPLICIT".

    For more details we need more info. See Pesos reply.



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

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