Question

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.

Was it helpful?

Solution

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...

OTHER TIPS

There is a command-line tool called XSD2DB, that generates database from xsd-files, available at sourceforge.

For more info: please refer to this existing question How can I create database tables from XSD files?

You can use an XSLT transform. See, for example, here: Generating SQL from XSD and XSL stylesheets with XSLT.

Microsoft has a command-line tool for performing XSLT transformations: Microsoft Command-Line tool for XSLT.

It is also easy to integrate the transforms into a build process using MSBuild or Grunt.

Here is the reference for the Microsoft documentation: XML Standards Reference, including XSD, XSLT, etc.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top