Table was created the sales schema
Chapter 31 ■ ObjeCts and dependenCies
Solution
31-3. Identifying Object Dependencies
Problem
-- Create two new databases
CREATE DATABASE TSQLRecipe_A;
GO
CREATE DATABASE TSQLRecipe_B;
GO
863
SQL Server provides methods for identifying object dependencies within the database, across databases, and across servers (using linked server four-part names). This following example demonstrates the use of the sys.sql_expression_dependencies object catalog view to identify dependencies in several scenarios.
I began by checking for the existence of two databases, and then dropping them if they existed. Next, I create two new databases and some new objects within them in order to demonstrate the functionality.
864