Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
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: 792 | Views in the last 30 days: 3
 
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

Reverse-Engineer Database Permissions (2005 up)

This script reverse engineers SQL statements to recreate database permissions.

 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones