Generate or create XSD Schema from Database Table in sql server 2005
create table Person
(
Age int not NULL check( Age > 0) ,
Height numeric(10,2) not NULL check( Height > 5),
Gender varchar(5) not null check( Gender in ('M', 'F', 'O')),
BirthDate datetime null,
)
DECLARE @schema xml
SET @schema = (SELECT * FROM Person FOR XML AUTO, ELEMENTS, XMLSCHEMA('PersonSchema'))
select @schema
OUTPUT:
5 Comments:
That's a very helpful post my friend, thanks a lot. I gained something from it
God Bless!
The reverse
http://xml2ddl.berlios.de/
Any tips on doing this on an entire database resulting in one XSD file?
alo interested in something that will generate for the entire database schema, rather than just a table...cheers.
Eden Eternal
Eden Eternal Gold
Eden Eternal Review
Post a Comment
<< Home