SQL-Server - Abhängige Objekte eines Objektes in T-SQL anzeigen
Anzeige aller abhängigen Objekte eines Objektes mittels T-SQL
/** Objekte die von einem Objekt abhängen */
SELECT
o.type_desc AS 'Typ',
OBJECT_SCHEMA_NAME(referencing_id) AS 'Schema',
o.name AS 'Name',
OBJECT_DEFINITION(referencing_id) AS 'Definition'
FROM sys.sql_expression_dependencies sed
INNER JOIN sys.objects o ON sed.referencing_id = o.object_id
WHERE referenced_id = OBJECT_ID(N'schema.tabelle')
ORDER BY o.type, OBJECT_SCHEMA_NAME(referencing_id), o.name