I need to get a list of the tables contained in a diagram in SQL Server. How can I do it using an SQL script?
I don't need a list of tables in the database, but the list of tables contained in a diagram of the database in SQL Server 2008r2/2012.
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.Sign up to join this community
Although this question is a year old, if anyone stumble over this, I've posted a solution to make that possible here:
The trick is to extract all ASCII characters in the diagram binary, you'll see that all table names are in there as simple text. That seems to be the reason why a diagram is also destroyed if you rename a table with a script - because it doesn't use a table ID to identify the table but the table name. If it's no longer there, the diagram is not usable anymore.
With this method you can identify which diagrams contains a specific table.