0

Is there any way to generate database-design diagrams using C# code?

I want to automate database design generation to be able to generate multiple sequence diagrams at once of different database types, e.g. SQL Server, Oracle, MySQL.

My basic approach:

I have to generate the ER diagram of around 100 applications. I have connection strings for all different applications. On connecting to its database server, I think I have to generate all model classes from SQL and use it to generate its ER diagram similar to the entity framework. Is there any better approach as I just want to generate ER diagrams only?

Let me know if any other information is required.

RahulGo8u
  • 148
  • 2
  • 19

1 Answers1

0

Database diagrams are supported by visual tool (SSMS) not by SQL Server. Hence, the goal is to automate the creation of diagram support for every database. There are at least two way :

  • (a little bit hacker way) to trace what SSMS is doing to add diagram support for a single database (normally, it creates one table and several stored procedures) then re-run this TSQL script for other databases. Pay attention for compatibility level of each database.
  • (more proper solution but not simple) to develop an add-in for SSMS (same approach than for VS add-in) which do the work as you do it manually
serge
  • 992
  • 5
  • 8