Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Objects Referenced and Referencing

By Charles Jacobus,

You can use the output of this script to analyze how a database object and even a specific column are used in the database. The results of this script are similar to the View Dependencies feature of SQL Server Management Studio. This script can be useful when making schema changes by helping you understand the scope and potential impact of those changes.

This script uses a few of SQL Server’s dynamic management views and functions. Part of the body of this script borrows from examples in Microsoft SQL Server Books Online (BOL).

The permissions required to use these views and functions will likely be granted to someone making DDL changes. (They include VIEW DEFINITION and CONTROL permissions. See BOL for the specific permissions required.) In the event that the account you run this script as doesn’t have the required permissions, one or more result sets may be empty.

To use the script, enter values for @SchemaQualifiedObjectName and (optionally) for @ColumnName, and execute it against a target database.

Total article views: 831 | Views in the last 30 days: 2
 
Related Articles
FORUM

Sql Script to change the Login Permission

Sql Script to change the Login Permission

FORUM

scripting a database without db owner permissions

scripting a database without db owner permissions

SCRIPT

Permission scripting over all databases

Scripts permissions/roles for db user across all databases.

FORUM

Permission change

Spontaneous permission changes all of a sudden

SCRIPT

Script DB Level Permissions v4

Script database and object level permissions for all database users

 
Contribute