Find All References for DB objects using a SQL Server Database Project

We use ‘Find All References’ a lot in Visual Studio to navigate around C#/VB code. By creating a SQL Server Database Project to store the definition of our DB objects we can also do this from a DB perspective. This is really useful when we have a large DB with lots of views, stored procedures, triggers, functions etc.

1 – Select a table from your DB project in solution explorer
2 – Right click table/column name and select ‘Find All References’

As an example the below image (click for a larger view in a new window) shows us that a column called ‘Url’ is found in three locations, the containing table, a view and a stored procedure.

Using Find all references in SQL Server DB Project

And of course don’t forget that because your SQL Database Project is under source control you can pull down a specific version of the project corresponding to a particular release and find all references based on the schema of your DB at that particular point in time.

Leave a Reply

Your email address will not be published. Required fields are marked *