I'm looking for exactly what Management Studio shows with the "View Dependencies" menu.
How do I get the same information programmatically? (an SQL query?)
Here is another simpler way:
SELECT DISTINCT
O.ID ,
O.Name AS TableName ,
O.xtype
FROM
sysObjects O ( NOLOCK )
INNER JOIN sysComments C ( NOLOCK ) ON O.ID = C.ID
WHERE
C.text LIKE '%<schema_name.function_name>%'
ORDER BY
XType ,
TableName
Before you run the following query, replace <schema_name.function_name> with a valid name
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With