I ran into a problem that I need to import huge XML (> 1Gb) daily into SQL Server 2008. Now I have a sample XML file and its XML schema. The XML schema is quite complex, which contains many custom simple types and an element with a complex type, for example:
<xs:element name="xxxx_url"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:anyURI"> <xs:attribute ref="target" use="optional"/> <xs:attribute ref="abc" use="optional"/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element>
After importing, the WCF service will be implemented to retrieve data stored in SQL Sever, something like search, retrieval, etc. (read-only operations).
The steps I can think of are like:
- To determine the object model according to the provided XSD (manually), the object model will be used for the WCF service to return values.
- Define the database schema from the provided XSD (manually), according to estimates, the schema has about 20-30 tables.
- Create an SSIS package to load XML daily into the database.
- Create a WCF service that reads from the database, fills in the data in the object model defined in step 1, and returns the object to the service client.
The problem is that these steps involve a lot of manual work. I have to examine the XSD line by line and convert it to an object model and a mannualy database schema.
I did some research that there are some automation tools for converting XSD to classes, as well as converting XSD to database schema. But the classes that were converted from XSD using the tool are rather confusing, and the conversion to the schema is not performed because it does not match the MS dataset format.
I am wondering if there is a good solution to this problem to save a lot of manual work?
Any suggestion appreciated!
c # xml sql-server xsd ssis
Veve
source share