By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,605 Members | 2,012 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,605 IT Pros & Developers. It's quick & easy.

Read (and Visualize) DB Schema from SQL Server

P: n/a
Hi experts,

which approaches would you suggest for:

- Reading a database schema (tables, fields, relationships) from SQL
Server 2005?
- Visualizing the DB schema?

For developing a DB tool the schema should be read from the server and
then be visualized, e.g. like the SQL Server BI Development Studio
does when importing the whole schema to a data source view.

Any ideas and hints on how to start approaching this (either reading
schema and/or visualizing it) using .NET (preferably C#) are welcome!
Regards,
Max

May 17 '07 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Max,

http://support.microsoft.com/kb/309488

I usually display the schema table info in a grid by binding the returned
table to a control like a datagridview.

Kerry Moorman
"se***************@googlemail.com" wrote:
Hi experts,

which approaches would you suggest for:

- Reading a database schema (tables, fields, relationships) from SQL
Server 2005?
- Visualizing the DB schema?

For developing a DB tool the schema should be read from the server and
then be visualized, e.g. like the SQL Server BI Development Studio
does when importing the whole schema to a data source view.

Any ideas and hints on how to start approaching this (either reading
schema and/or visualizing it) using .NET (preferably C#) are welcome!
Regards,
Max

May 17 '07 #2

P: n/a
On 17 Mai, 15:10, Kerry Moorman
<KerryMoor...@discussions.microsoft.comwrote:
http://support.microsoft.com/kb/309488

I usually display the schema table info in a grid by binding the returned
table to a control like a datagridview.
Thanks a lot for this hint, Kerry! Using the code presented in the
knowledge base article I was able to read the basic schema
information.

Now that I have the schema information, the problem is visualizing it
neatly in a GUI. Something like: Tables are depicted as boxes,
containing the fields of the table as rows showing the name and type
of the field. Fields acting as primary or foreign keys are specially
marked. Relationships between tables are depicted as lines connecting
the tables. The graphical representation should be used to enable the
user to navigate the schema, select a table and perform basic
operations on them.

Which .NET framework could I use to realize such a graphical
representation of the schema?
Regards,
Max

May 18 '07 #3

P: n/a
Max,

I have always used the schema information for myself as a developer, so my
presentation usually just consists of displaying the data in a grid.

For your needs you might want to model your presentation on something like
SQL Server's Management Studio.

You could use a Treeview control in a pane on the left and a grid control in
a pane on the right to allow the user to view, navigate and interact with the
data.

Anything more sophisticated would really be turning into an
Entity-Relationship Diagramming application and that would be a considerable
undertaking.

Kerry Moorman
"se***************@googlemail.com" wrote:
On 17 Mai, 15:10, Kerry Moorman
<KerryMoor...@discussions.microsoft.comwrote:
http://support.microsoft.com/kb/309488

I usually display the schema table info in a grid by binding the returned
table to a control like a datagridview.

Thanks a lot for this hint, Kerry! Using the code presented in the
knowledge base article I was able to read the basic schema
information.

Now that I have the schema information, the problem is visualizing it
neatly in a GUI. Something like: Tables are depicted as boxes,
containing the fields of the table as rows showing the name and type
of the field. Fields acting as primary or foreign keys are specially
marked. Relationships between tables are depicted as lines connecting
the tables. The graphical representation should be used to enable the
user to navigate the schema, select a table and perform basic
operations on them.

Which .NET framework could I use to realize such a graphical
representation of the schema?
Regards,
Max

May 18 '07 #4

P: n/a
You mean besides the Database Diagrams supported in SQL Server EM and MS and
since VB classic?

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

<se***************@googlemail.comwrote in message
news:11**********************@e65g2000hsc.googlegr oups.com...
Hi experts,

which approaches would you suggest for:

- Reading a database schema (tables, fields, relationships) from SQL
Server 2005?
- Visualizing the DB schema?

For developing a DB tool the schema should be read from the server and
then be visualized, e.g. like the SQL Server BI Development Studio
does when importing the whole schema to a data source view.

Any ideas and hints on how to start approaching this (either reading
schema and/or visualizing it) using .NET (preferably C#) are welcome!
Regards,
Max

May 18 '07 #5

P: n/a
On 18 Mai, 22:45, "William \(Bill\) Vaughn"
<billvaRemoveT...@betav.comwrote:
You mean besides the Database Diagrams supported in SQL Server EM and MS and
since VB classic?
Database Diagrams would be a good option for visualizing a database
schema. But if I decide to offer this representation to the users of
an application, the question arises, how to automatically generate a
Database Diagram from a given database and how Database Diagrams can
be (re)used to offer the user a visual design environment in my own
application. The user of the application should be able to browse/
navigate the database schema in a graphical way, select some tables
and perform some (nontrivial) operations on them.

I'm quite interested in any way to embed such a kind of visualization
or design environment in a .NET application. Which frameworks can I
use, to minimize my development effort? Is it possible to reuse /
embed some specialized components for this from SQL Server or BI
Development Studio in a .NET application?

Regards,
Max

May 20 '07 #6

P: n/a
On 18 Mai, 18:02, Kerry Moorman
<KerryMoor...@discussions.microsoft.comwrote:
Anything more sophisticated would really be turning into an
Entity-Relationship Diagramming application and that would be a considerable
undertaking.
I think I'm realizing this more and more. Isn't there any possibility
to reuse a design environment component offered by the SQL Server
products, like e.g. for designing Database Diagrams or Data Source
Views in SQL Server BI Development Studio? Or at least, to use the
framework these design environments are based on? Perhaps something
like the Eclipse Modeling Framework (EMF) existing in the Java world
or even more sophisticated and specialized for database schema
modeling?

Perhaps let's make it more general: Which framework I can use, if I
want to create a .NET application offering a visual modeling
environment (e.g. for UML, ER, ...)?

Any ideas, hints, suggestions?

Regards,
Max

May 20 '07 #7

P: n/a
The diagramming tool will automatically build a diagram from an existing
schema--mapping the relationships and all.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

<se***************@googlemail.comwrote in message
news:11**********************@a26g2000pre.googlegr oups.com...
On 18 Mai, 22:45, "William \(Bill\) Vaughn"
<billvaRemoveT...@betav.comwrote:
>You mean besides the Database Diagrams supported in SQL Server EM and MS
and
since VB classic?

Database Diagrams would be a good option for visualizing a database
schema. But if I decide to offer this representation to the users of
an application, the question arises, how to automatically generate a
Database Diagram from a given database and how Database Diagrams can
be (re)used to offer the user a visual design environment in my own
application. The user of the application should be able to browse/
navigate the database schema in a graphical way, select some tables
and perform some (nontrivial) operations on them.

I'm quite interested in any way to embed such a kind of visualization
or design environment in a .NET application. Which frameworks can I
use, to minimize my development effort? Is it possible to reuse /
embed some specialized components for this from SQL Server or BI
Development Studio in a .NET application?

Regards,
Max

May 21 '07 #8

P: n/a
On 21 Mai, 18:01, "William \(Bill\) Vaughn"
<billvaRemoveT...@betav.comwrote:
The diagramming tool will automatically build a diagram from an existing
schema--mapping the relationships and all.
This seems to be some kind of misunderstanding. I'm aware of the fact,
that there are tools which offer the possibility to read the schema
and build visualizations of it. That's not the point. The point is,
that I'm planning to develop a .NET (C#) application and need to add a
small "design environment" to this application which shows such a
database / schema diagramm and offers the user the possibility to
browse the schema in a graphical way, select some tables and perform
operations on it. (Note that the operations I mentioned are very
special and not offered by any exiting tool.)

The question is, which .NET frameworks exist to simplify this and cut
down development efforts. As I figured out, reading the meta-data is
quite easy, but until now I have no idea how to start building the
"design/modeling environment" (e.g. creating dragable graphical tables
and a neat layout of connecting relationship lines). Perhaps there is
a possibility to reuse the frameworks or components the Microsoft
tools are based on?

Any suggestions? (Apart from suggesting the use of some closed-source
tools? :-)

Regards,
Max

May 21 '07 #9

This discussion thread is closed

Replies have been disabled for this discussion.