How to: View Dependencies for Database Objects

For any object in Schema View, you can view the objects that depend on that object and the objects upon which that object depends. The dependencies appear in the Schema Dependency Viewer and are displayed as a tree. Note that the actual dependencies are modeled as a graph. You might want to view the dependencies for an object before you consider renaming or removing that object.

You can view dependencies for multiple items in the Schema Dependency Viewer. Each time that you view a new object, it is added to the displayed items. You can remove items when they are no longer of interest. When you close and re-open Visual Studio, the Schema Dependency Viewer is reset to an empty state because the objects in the Schema Dependency Viewer are not persisted.

Important

The Schema Dependency Viewer is not available in Visual Studio Professional. You must have Visual Studio Premium or Visual Studio Ultimate to use the Schema Dependency Viewer.

To view dependencies for a database object

  • In Schema View, right-click the object whose dependencies you want to display, and then click View Dependencies.

    The Schema Dependency Viewer appears.

To remove an object from the Schema Dependency Viewer

  • In Schema Dependency Viewer, right-click the object that you want to remove, and then click Remove.

    Note

    You can also click Remove All to remove all currently displayed objects from the Schema Dependency Viewer.

To view the definition for an object that appears in the Schema Dependency Viewer

  • In Schema Dependency Viewer, right-click the object for which you want to view the definition, and then click Open.

    The Transact-SQL editor appears and displays the definition of the specified object.

To view the file that contains the definition for an object in the Schema Dependency Viewer

  • In Schema Dependency Viewer, right-click the object for which you want to view the related file, and then click View File in Solution Explorer.

    Solution Explorer receives focus, and the file that contains the specified object is highlighted.