How to find the dependencies on a specified function?

Published 23 July 07 02:29 AM | SQL Master 
Version: SQL Server 2005
Change Database name  & function name within the query.
USE <database_name>;
GO
SELECT OBJECT_NAME(object_id) AS referencing_object_name
    ,COALESCE(COL_NAME(object_id, column_id), '(n/a)') AS referencing_column_name
    ,*
FROM sys.sql_dependencies
WHERE referenced_major_id = OBJECT_ID('<schema_name.function_name>')
ORDER BY OBJECT_NAME(object_id), COL_NAME(object_id, column_id);
GO 
Filed under: , ,

Comments

# SSQA.net - SqlServer-QA.net said on July 23, 2007 6:17 PM:

Version: SQL Server 2005 Change Database name &amp; function name within the query. USE &lt;database_name&gt;;

Anonymous comments are disabled

About SQL Master

**__________________________________** SQL Server MVP, Sr. DBA & industry expert. - Knowledge is of two kinds. We know a subject ourselves or we know where we can find information on it. It is also a power and you will gain by sharing it.