Up:: MS Sql
Get the foreign keys to a table in MS Sql
-
Language:: T-SQL
-
Type:: Persistent Storage
-
Context:: Getting the tables that are linked to the queried table using foreign keys
-
Snippet
EXEC sp_fkeys 'TableName'
You can also specify the schema:
EXEC sp_fkeys @pktable_name = 'TableName', @pktable_owner = 'dbo'
- Dependencies:: How can I list all foreign keys referencing a given table in SQL Server? - Stack Overflow
📇Additional Metadata
- 📁Type::#type/snippet
- 🏷️Tags::
- 📡Status::#status/🌲