Solved

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

Posted on 2003-12-02
7
965 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Problem to DocumentFormat 8 67
CSS (line height?) issue 2 57
I starting with php 12 95
Problem to picture file 3 41
Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

747 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

14 Experts available now in Live!

Get 1:1 Help Now