views:

5960

answers:

3

Is there something available that could help me convert a XSD into SQL relational tables? The XSD is rather big (in my world anyway) and I could save time and boring typing if something pushed me ahead rather than starting from scratch.

The XSD is here if you want to have a look. It's a standardized/localized format to exchange MSDS.

A: 

XSD is XML. Write a utility class to read and parse the XSD and walk the tree to create the SQL CREATE statements you need.

duffymo
+2  A: 

Altova's XML Spy has a feature that will generate SQL DDL Script from an XSD file. XML Spy will cost you some money though.

Interestingly enough, a developer used a really clever trick of using an XSLT translation to create the DDL script from an XSD file. They have outlined it in two parts here and here.

I might have to try this out myself for future use...

EDIT: Just found this question asked previously here...

Dillie-O
ha...you beat me to the punch. xml spy is such an indispensable tool, well worth the money. +1
Kev
Didn't know that, thanks.
duffymo
A: 

Try to use Zum Coder to convert xsd schemas into a table. Please go to http://www.zumcoder.com.br sign up and start to use this code generator that among other features can generate SQL scripts from xsd, html form

Zum Coder