471,616 Members | 1,076 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,616 software developers and data experts.

Generating XSD

Ram
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
Nov 12 '05 #1
3 2998
HG
Hi there

Search for xsd.exe on MSDN. It's the "schema compiler". I think it can do
what you want...but not quite sure.
"Ram" <Ra*@discussions.microsoft.com> skrev i en meddelelse
news:B1**********************************@microsof t.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

Nov 12 '05 #2
Hi Ram

If you are using Visual Studio .NET, then you can create this sort of thing
visually using the DataSet designer, drag and drop the tables from Server
Explorer onto the design surface. You can set up relationships (between
tables!) in the designer as well.

HTH

Nigel Armstrong

"Ram" wrote:
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

Nov 12 '05 #3
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

"Ram" <Ra*@discussions.microsoft.com> wrote in message
news:B1**********************************@microsof t.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

Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by paul | last post: by
reply views Thread by Dan Gass | last post: by
17 posts views Thread by flupke | last post: by
3 posts views Thread by skn | last post: by
3 posts views Thread by Raed Sawalha | last post: by
reply views Thread by leo001 | last post: by
1 post views Thread by ZEDKYRIE | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.