?
Solved

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

Posted on 2003-12-02
7
Medium Priority
?
1,014 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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

Automating Terraform w Jenkins & AWS CodeCommit

How to configure Jenkins and CodeCommit to allow users to easily create and destroy infrastructure using Terraform code.

Question has a verified solution.

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

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…
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
The viewer will learn how to count occurrences of each item in an array.
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)
Suggested Courses

762 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