问题
I would like to create a database diagram in SQL Server 2008 and have a View in the diagram. is there a way to do this?
回答1:
I don't think so. SQL Server Management studio allows only Tables to be included in the database diagram. If you have Microsoft Visio, you can use that to include the Views in your database diagram.
回答2:
Download SQL Sentry Plan Explorer - this is a free app that significantly extends the built-in execution plan functionality in Management Studio. Also grab the Management Studio add-in (you'll have to re-start SSMS). Once installed, in SSMS, run the following query, with "Actual Execution Plan" turned on:
SELECT * FROM dbo.view;
Right-click the Execution Plan and choose "View with SQL Sentry Plan Explorer."
Once the plan is open in Plan Explorer, you can see the base tables that are referenced by the view (even if they are nested) on the Join Diagram tab in the lower pane.
Disclaimer: I work for SQL Sentry, but there are absolutely no strings attached.
来源:https://stackoverflow.com/questions/7194948/is-there-a-way-to-visually-display-a-view-in-a-database-diagram-in-sql-server-20