Is there a way to visually display a View in a database diagram in SQL Server 2008?
I would like to create a database diagram in SQL Server 2008 and have a View in the diagram开发者_StackOverflow中文版. is there a way to do this?
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.
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.
精彩评论