Skip to content

Instantly share code, notes, and snippets.

@tomfa
Created September 29, 2024 06:18
Show Gist options
  • Save tomfa/1f949102c93e61db4d4f8c8826f9f40b to your computer and use it in GitHub Desktop.
Save tomfa/1f949102c93e61db4d4f8c8826f9f40b to your computer and use it in GitHub Desktop.
MSSQL find all referencing FKs
SELECT
referencing_schema_name, referencing_entity_name, referencing_id,
referencing_class_desc, is_caller_dependent
FROM
sys.dm_sql_referencing_entities ('REPLACE_WITH_TABLE_NAME', 'OBJECT');
GO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment