469,283 Members | 2,297 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,283 developers. It's quick & easy.

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 2952
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 zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.