Solved

Tools to create .xsd and sql schema from .xml file

Posted on 2003-12-02
7
977 Views
Last Modified: 2013-11-19

Hello,

I am trying to use SqlXML 3.0 SP2 to "Bulk Upload" an XML Document directly to my sql database.

I, however, have the following questions:

1. Given an .xml file, how do I generate an .xsd for it?  I have explored using the Microsoft XSD Inference Tool "infer.exe" and using the XML Schema Definition Tool (Xsd.exe from VS.Net 2003).  Both produce .xsd files, but do not seem to encapsulate relationships (e.g., sql:relation= or sql:relationship=) between the elements.

2. Given an .xsd file, are there any tools to create a sql schema from the .xsd file?

I am primarily interested in Microsoft tools for the above.

TIA,

-RD



0
Comment
Question by:rdefuria
  • 4
  • 3
7 Comments
 
LVL 15

Expert Comment

by:dualsoul
ID: 9861419
the answer to both your questions (generations of xsd and sql schema by this xsd) is XMLSpy from Altova corporation - it's a very cool, and have both functions you need.

      But it's not Microsoft tool, but anyway you can try it, and solve does it suite your needs.
   You can download free trial from www.altova.com or www.xmlspy.com

Hope it helps.
0
 

Author Comment

by:rdefuria
ID: 9866227

Thanks for the tip.  I have downloaded an eval version of XMLSpy Enterprise version.  If you are familiar with it, how do I generate xsd from xml, and how do I then generate a sql schema from that?


0
 
LVL 15

Expert Comment

by:dualsoul
ID: 9866898
menu->DTD/Schema->generate DTD/Schema, as i remember, i take a look at it ealier and say you more precisely
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 15

Expert Comment

by:dualsoul
ID: 9869371
ok, here i am :) so:
 to generate W3C schema:
        open your xml file in XMLSpy and then DTD/Shema (from menu)->Generate DTD/Schema...
               then select schema type you want (DTD or W3C or what you want)
       
 to generate Databse schema:
      Convert (from menu)->Create Database Schema, then select DB, XMLSpy supports Oracle, MS SQL,  you will see. Please note you should point how to connect to your Database instance then.

Hope it help
0
 

Author Comment

by:rdefuria
ID: 9882195
Hi, dualsoul,

i have tried to use xmlspy.

i have generated an xsd file from my xml file.

however, the Convert -> "create database schema" option you suggested to import to sql server seems to require that a database with a schema already exist.

did you mean Convert -> "Create DB Structure based on Schema" ?

Remember, I am looking for a way to create the sql schema for an xml file so I can use SqlXML 3.0 SP2 to "Bulk Upload" an XML Document directly to sql server.

Even though this is not a MS solution, you'll get the points if we can clear up this last piece.

-RD
0
 
LVL 15

Accepted Solution

by:
dualsoul earned 300 total points
ID: 9885066
>Even though this is not a MS solution
hm....you know, you can download XMLSpy VisualStudio .NET edition, to embed XMLSpy in VS.NET if you need this.

did you mean Convert -> "Create DB Structure based on Schema" ?
hm... you generate Schema from xml, and do Convert -> "Create DB Structure based on Schema" (it won't be enabled option for xml file, only for Schemas)->select some DB (i've just tried it with Access, cause i haven't Oracle or MSSQL installed for now), and then it creates for you new Database with tables and relational based on your Schema. It's works fine, i've just checked it up :)

or may be i didn't get what you exactly want?
0
 

Author Comment

by:rdefuria
ID: 9896224

No, that is what I want.  But I find that XMLSpy does not create any relationships between the tables.
That is, no parent-child relationships.

How do I get the database schema it creates to reflect the relationships between various tables?

Do I have to add those by hand?

0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question