Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 creating sql server table stucture from xsd file

Author  Topic 

rtutus
Aged Yak Warrior

522 Posts

Posted - 2006-12-08 : 01:34:30
Can we do that and how pls?
The purpose is to avoid creating sql server table structure manually when we already have xsd file.

Kristen
Test

22859 Posts

Posted - 2006-12-08 : 03:54:56
The SQL Bulk XML Load object has the ability to do that. Dunno about anything else though. Some extension to XML Spy maybe?

Kristen
Go to Top of Page

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2006-12-08 : 09:27:28
Have a look at the SchemaGen property on the SQLXML classes:

http://msdn2.microsoft.com/en-us/library/ms171806.aspx




http://www.elsasoft.org
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2006-12-08 : 10:09:15
what is an xsd file?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2006-12-08 : 10:46:45
XML Schema Definition

Jay
to here knows when
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2006-12-08 : 11:47:07
So, is this an example?


<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="book">
<xs:complexType>
<xs:sequence>
<xs:element name="title" type="xs:string"/>
<xs:element name="author" type="xs:string"/>
<xs:element name="character" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="friend-of" type="xs:string" minOccurs="0"
maxOccurs="unbounded"/>
<xs:element name="since" type="xs:date"/>
<xs:element name="qualification" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="isbn" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:schema>



And if everything is element name, then when it as a type it's a cloumn, when it doesn't it's a table?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

snSQL
Master Smack Fu Yak Hacker

1837 Posts

Posted - 2006-12-08 : 12:48:40
Yes, that's an example of an XSD. Mapping a schema to relational data and vice versa is tricky but can certainly be done with automated tools - it's referred to as schema inference. It happens in the .NET Framework when you work with DataSets and there is a nice description of the process here (there are no standard rules for schema inference as far as I know, each tool follows a set of rules though and these are the ones .NET follows)
http://msdn2.microsoft.com/en-us/library/aa720672(VS.71).aspx
Go to Top of Page
   

- Advertisement -