I have a Visual Studio project where I have scripted out my dbo.sysdiagrams. When I deploy my project the whole database is dropped and recreated from the scripts I have. One of my post deploy scripts creates dbo.sysdiagrams and fills in the diagram(s) that I have scripted out.
I thought that dbo.sysdiagrams would be all I needed to get diagramming working. But after I run my script, I go to the "Database Diagrams" folder and refresh it and I get this error message:
开发者_运维问答This database does not have one or more of the support objects required to use database diagramming. Do you wish to create them?
After I click yes, my diagram(s) show up just fine. But it is annoying to have to do this every time I deploy (ie a couple times a week).
What other data/object am I missing that causes this dialog to appear?
There are also several stored procedures and a function that are added to the database. This page lists all the objects that are created: http://msdn.microsoft.com/en-us/library/ms171974%28v=VS.100%29.aspx
Check out the following question here.
Steps from that answer.
The script is a little too long to add here, but here's what you can do. 1) Create a new database. 2) Start sql server profiler 3) Click the "Database Diagrams" folder in management studio. 4) Clear the profiler. 5) Confirm the message box with a prompt to enable diagramming. 6) Profiler now contains the script that enabled diagramming. 7) Select the script in profiler and copy the output from the bottom pane.
Then you can include this script in your deployment.
精彩评论