Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys,I am working on SSIS, my question is I want to write a ssis package to parse XML file and the output should store in the database.
actual output should be like this in the database:
metername ,serial number,meterreadingid,medaitype,installdate
and here is the code

XML
-<AMRDEF CreationTime="2013-08-09 00:18:42" version="7.0" Purpose="AMRDataRequest">


-<MeterReadings Purpose="OnRequestRead" CollectionTime="2013-08-09 19:57:11" Initiator="OnRequest" SourceIrn="30" SourceName="coll_0591_stuart" Source="Remote" Irn="21">

<Meter MediaType="900 MHz" ObservesDaylightSavings="true" TimeZoneOffset="300" Timezone="(GMT-05:00) Eastern Time (US & Canada)" TimeZoneIndex="11" Location="" SdpIdent="" AccountName="" AccountIdent="" RemovalDate="" InstallDate="2013-05-01 20:28:09" Description="" MeterType="REX" SerialNumber="03310266" IsActive="true" MeterName="03310266" MeterIrn="21"/>


+<ConsumptionData>


-<ConsumptionData>

<ConsumptionSpec Multiplier="1" MeasurementPeriod="EndOfIntervalSnapshot" TouBucket="Total" Direction="Received" UOM="kWh"/>

<Reading Value="0" TimeStamp="2013-08-09 00:00:00"/>

</ConsumptionData>


-<LoadProfileSummary>

<Channel Multiplier="0.1" Direction="Delivered" UOM="kWh" SumOfIntervalValues="155316.3" ReadingRangeEndTimestamp="2013-08-09 00:00:00" ReadingRangeStartTimestamp="2013-08-02 00:00:00" FirstIntervalTimestamp="2013-08-02 00:15:00" NumIntervalsRead="675" IntervalSeconds="900"/>

<Channel Multiplier="0.1" Direction="Received" UOM="kWh" SumOfIntervalValues="0" ReadingRangeEndTimestamp="2013-08-09 00:00:00" ReadingRangeStartTimestamp="2013-08-02 00:00:00" FirstIntervalTimestamp="2013-08-02 00:15:00" NumIntervalsRead="675" IntervalSeconds="900"/>

</LoadProfileSummary>


+<IntervalData>









































-<IntervalData>

<IntervalSpec Multiplier="0.1" Direction="Received" UOM="kWh" TimestampEnd="2013-08-09 00:00:00" TimestampStart="2013-08-02 00:15:00" Channel="2" Interval="15"/>

<Reading TimeStamp="2013-08-02 00:15:00" RawReading="0"/>

<Reading TimeStamp="2013-08-02 00:30:00" RawReading="0"/>

<Reading TimeStamp="2013-08-02 00:45:00" RawReading="0"/>

<Reading TimeStamp="2013-08-02 01:00:00" RawReading="0"/>

<Reading TimeStamp="2013-08-02 01:15:00" RawReading="0"/>

<Reading TimeStamp="2013-08-02 01:30:00" RawReading="0"/>

<Reading TimeStamp="2013-08-02 01:45:00" RawReading="0"/>


What I have tried:

what I did: In this package, I haven't written any code for parsing.here is the output I am getting direct headers and I am not getting the all the data from the input data file and need to read the data for each header and get each reading value,
can anyone please help me on this task how to create the SSIS package, This help is greatly appreciated,
Thanks.
Posted
Updated 19-May-17 17:48pm
v2
Comments
PIEBALDconsult 19-May-17 23:46pm    
SSIS does XML. What's the problem?
Akhil Madivada 20-May-17 1:43am    
yeah you right SSIS does XML but finding difficult in creating packages for my XML data ,I need output with metername ,serial number,meterreadingid,medaitype,installdate from XML data. I don't know how to create package in SSIS can you please help me on that.
Thank your for your response.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900