question

Raj More avatar image
Raj More asked

XSD structure and Table Structure

We get an XML file that I have to parse and store in a database. The values are coming in as a Name-Value pair instead of regular XML. I do not want to store it as a name-value pair. The Start-Time and Stop-Time can be ignored (they repeat). I would rather build columns like CREDIT_RATING, UNIT_ARR_CREDIT_RATE, UNIT_CAP_CHRG_ATC_KWH, T01_UNIT_FIXED_ENRGY_COST_ATC to hold the values. How do I go about building an XSD to use in SSIS for this?
ssissql-server-2008-r2xmlxsd
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Fatherjack avatar image
Fatherjack answered
I am (happily?) rubbish at XML so you may get a proper answer from someone else in due course but have you tried using SSIS or LogParser to handle the import? SSIS allows you the option to generate an XSD from the source file. LogParser may not need one.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Raj More avatar image
Raj More answered
We ended up using the XML Task and applied an XSLT (transform) to move the attributes to elements.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.