Jasinski Technical Wiki

Navigation

Home Page
Index
All Pages

Quick Search
»
Advanced Search »

Contributor Links

Create a new Page
Administration
File Management
Login/Logout
Your Profile

Other Wiki Sections

Software

PoweredBy

Tables Used by Stored Procedures - SQL Server

RSS
Modified on Thu, Jul 02, 2009, 2:51 PM by Administrator Categorized as SQL Server
The following SQL statement will return a list of all dependencies of stored procedures on user tables.

select distinct
     StoredProcedureName = a.name
    ,TableName           = b.name

from 
    sys.objects a

    inner join sys.sql_dependencies d
        on a.object_id = d.object_id

    inner join sys.objects b
        on b.object_id = d.referenced_major_id

ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.