Solved

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

Posted on 2003-12-02
7
971 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
XML file fails to process correctly 3 50
JQuery tracking event. 3 57
Problem to picture file 3 68
How do I bind the results to a grid 3 34
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…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

920 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now