SQL Dependencies in SQL Server 2008


Description: In this article I will describe how to do SqlDependencies in SQL Server 2008 using SQL Server Management Studio:

Content:

User-defined database objects can have dependencies upon other user-defined database objects.

For example, views and stored procedures depend upon the existence of tables that contain the data returned by the view or procedure. Before modifying or moving a database object, it is important to identify the objects that depend upon that object as well as the database objects that must be present for the object to function properly.

Now for using the SQL Dependencies we can see a table whether it is dependent on which tables, stored procedures, views, triggers etc.

Reference : Microsoft

For doing that:

Step 1:

Open SQL Server 2008.

Step 2:

Expand Databases. For my case I expand my "Silvideoproject" just like the following Figure 1 marked with red:

Sql1.gif

Figure 1:

Step 3:

Now select a particular object; a table. For my case I have selected "dbo.tblVideo_Desc" like in the following figure marked with red.

Sql2.gif

Figure 2:

Step 4:

Now right-click on that particular table and click the View Dependences just like in the following figure:

Sql3.gif

Figure 3:

After clicking that you will see as in the following figure:

Sql4.gif

Figure 4:

In the above picture we have seen that my table "tblVideo_desc" is dependent on so many objects like stored procedure, views, tables which I have marked with red.

Now if you click the other radio button named "object on which[tblVideo_Desc] depends" you will see like the following figure:

Sql5.gif

Figure 5:

Here you have seen that my table "tblVideo_Desc" is dependent on "tblVideo" which I marked with red.

Conclusion:

So in this article We have seen how we can get the view dependency object of a particular table by using "object Dependency".

Up Next
    Ebook Download
    View all
    Learn
    View all