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.
| 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 |
 |
|
|
jezemine
Master Smack Fu Yak Hacker
2886 Posts |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2006-12-08 : 10:46:45
|
| XML Schema DefinitionJayto here knows when |
 |
|
|
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?Brett8-)Hint: Want your questions answered fast? Follow the direction in this linkhttp://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxAdd yourself!http://www.frappr.com/sqlteam |
 |
|
|
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 |
 |
|
|
|
|
|