Is it possible to query a database diagram?
-
Wednesday, March 21, 2012 11:59 AM
Is it possible to query a database diagram to count how many table it contains? So I only want to know how many tables thats in a certain diagram?
Like
select * from dbo.sysdiagrams as s where s.name = 'dbo_diagram'
But with that im only getting diagramid, version etc..
Or something like this
EXEC sp_MSforeachtable 'USE [?]; SELECT ''?'' COUNT(*) FROM dbo.sysdiagrams as s where s.name = ''dbo_diagram'
Is it possible to query a diagram like this?
- Edited by labrinths Wednesday, March 21, 2012 11:59 AM
All Replies
-
Wednesday, March 21, 2012 12:28 PM
Hello,
The diagram is stored binary encoded in sysdiagrams, you can't query it directly.
Olaf Helper
* cogito ergo sum * errare humanum est * quote erat demonstrandum *
Wenn ich denke, ist das ein Fehler und das beweise ich täglich
Blog Xing- Proposed As Answer by Kalman TothMicrosoft Community Contributor Wednesday, March 21, 2012 11:57 PM
- Marked As Answer by amber zhangModerator Thursday, March 29, 2012 6:07 AM
-
Tuesday, March 27, 2012 11:15 AM

