Microsoft® SQL Server™ 2008 All-In-One Desk Reference For Dummies®
by Robert D. Schneider, Darril Gibson
II.5.2. Determining Dependencies
Dependencies refer to the interrelationships among objects in your database. A foreign key relationship is the most commonly encountered dependency.
As your database grows in size, it can be difficult to keep track of exactly which objects depend on other objects. Compounding this confusion is that these interdependencies often cascade throughout the database.
Fortunately, SQL Server makes it easy for you to untangle this potentially complicated picture. Here's how to do it:
Launch the SQL Server Management Studio.
Connect to the appropriate SQL Server instance.
Expand the connection's entry in the Object Explorer view.
Expand the Databases folder.
Expand the Tables folder.
Right-click the table you want to examine and choose View Dependencies.
You see a new dialog box that allows you to view both objects that depend on this table and objects upon which this table depends. Figure 5-3 shows an example of what this looks like.
Figure II.5-3. Dependencies for a given table displayed in the SQL Server Management Studio.
In this case, you can see that the payments and student_courses table depend on the students table. But wait, there's more! Expanding the payments table shows that the student_payments table also depends on the students table. Knowing these details helps you understand the potential ramifications of any database alterations. It's better ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access