.net – 从MS SQL数据库获取XML模式

前端之家收集整理的这篇文章主要介绍了.net – 从MS SQL数据库获取XML模式前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
是否可以使用.Net和C#以编程方式生成数据库XML Schema?我想查看NDbUnit,但是对于大型数据库,手动进行Schema实在不太可行?

解决方法

Is it possible to generate a XML
Schema from a Database?

肯定的是,XMLSpy可以从数据库生成XML模式.

another way,虽然我从来没有测试过:

@H_404_15@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

猜你在找的MsSQL相关文章