Home All Groups Group Topic Archive Search About

Re: Generating XSD

Author
19 Nov 2004 8:58 PM
John
Hi Sairam,

If you want to do this programatically you can use SQLDMO to read SQL Server
table properties
including column names and types, unique/primary/foreign key contraints,
etc.

Then use the .NET XmlSchema class to generate a schema matching the manually
generated typed dataset in VS.

Once you have this dataset schema you can load it into an new empty DataSet
object instance or use the xsd to generate a code class using xsd.exe.

The nice part is that you can do a better job than VS and include all keys
automatically as well as naming them according to their name in SQL Server
unlike the auto-generated names VS creates.

Hopefully this will get you started. Good luck.

Regards,
John

Show quote
"Ram" <R**@discussions.microsoft.com> wrote in message
news:B198BF89-699D-4E81-834C-BC354538BC77@microsoft.com...
> Hi,
> How can i generate an XSD for a set of SQL Server tables(i have three
> tables. One table is parent of other two tables.) programatically or using
> a
> tool.
>
> Thanks in advance.
> Regards,
> Sairam

AddThis Social Bookmark Button