开发者

What is database objects are needed for a Database Design in SQL Server 2008 R2?

开发者 https://www.devze.com 2023-03-22 03:48 出处:网络
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 c

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号