sql server find all foreign keys that reference a column

Solutions on MaxInterview for sql server find all foreign keys that reference a column by the best coders in the world

showing results for - "sql server find all foreign keys that reference a column"
Daniel
15 Feb 2018
1EXEC sp_fkeys 'TableName'
Sara
24 Sep 2019
1SELECT 
2   OBJECT_NAME(f.parent_object_id) TableName,
3   COL_NAME(fc.parent_object_id,fc.parent_column_id) ColName
4FROM 
5   sys.foreign_keys AS f
6INNER JOIN 
7   sys.foreign_key_columns AS fc 
8      ON f.OBJECT_ID = fc.constraint_object_id
9INNER JOIN 
10   sys.tables t 
11      ON t.OBJECT_ID = fc.referenced_object_id
12WHERE 
13   OBJECT_NAME (f.referenced_object_id) = 'YourTableName'
queries leading to this page
sql server query all foreking keys to specific tablesql find foreign key references for tablefind all foreign keys referencing a tablefing all refernced table to foreing key sqllist of foreignkey references in sql databasesql get foregn key in querysql server show foreign keys for tablesql find all tables with foreign key to tablecheck all foreign keys sql serverhow to find table name from foreign key in sql serverfind all foreign keys referencing a table sql servertsql find foreign key referencessql get table foreign keysget foreign keyhow to show all references foreign keylist of tables referencing another table sq 3bl serversql find foreign key referencessql where foreign key in listget table by foreign keysql server get table foreign keyssql server find all foreign keys that reference a columnsql view all foreign keyfind all foreign keys in database sql serversql server fetch foreign key base and primary tablehow to get the foreign keys of a table in sqlsql server get foreign key how to get foreign keys of a table in sqlsql server how to find foreign key referencesmssql get foreign keys columnscheck where key is referenced in all tablesfind all tables with foreign key to tablesql server find all foreign keys pointing to my tabllehow to get all foreign keys from sql serverhow to get foreign key in sql tablesql select all where foreign key is in the listsql list all foreign key constraints for columnsql server query all foreign keys relationshipsqlserver how to find out all foreign key referencessql server get table fksql server get foreign key tablesget data from foreign key table sqlsql find all foreign keys to a tabletsql find a foreign key by namesql foreign key listsql server query all foreign keyssql server find table foreign key referencessql show foreignkeysshow table foreign keys sqlserverall the foreign keys in pcshop sqlt sql get foreign keys of tableget foreign key references table sqlt sql find all foreign key referencessql server finding foreign key referencessql query to find foreign key references of a tablesql server find all foreign keys pointing to my tablelist foreign key constraints sql serverselect all foreign keys sql serverselect all foreign key constraints sql serverhow to get foreign key references in sql tabletsql find all foreign keyssql get foreign keyget foreign keys of table sqlget table of foreign key sqlhow to know foreign key references for a table in sql serverlist table foreign keys sqlsql server find all foreign key references to a tablehow to to get all foreign key column name and table name in sqlsql show table show foreign keymssql query show table primary and foreign keyssql server select 2a from sys foreign keys 3b for one tablesql find all foreign key referencessql find all tables with foreign key likeget all foreign keys of a table sql serverhow to find all foreign keys in sql serverget information from a table with a foreign keys sql servermssql find foreign key referencesfind out which table foreign key orcaleselect foreign key sqlsql see foreign keys of a columnsql list foreign key constraints for given columnget all foreign keys in sql serversql show foreign keyssql find all tables with foreign keysql script to check if foriegn keys found in tablesql server query all foreign tablesget all constraints dependent on certain table mssqlsql list all actions of foreign keyfind out which table foreign key sql serversql server get fk onlysql server find tables referenced foreign keyfind all foreign keys referencing a table in sql serversql command to find foreign key referenceshow to get list of foreign keys in sql serversql server get column foreign keysql server see what foreign keys reference columnsql get row and all foreign key referencessql server show foreign key constraintssee all foreign keys sql serversql show the table of the foreign key list of all foreign key in sqlsql server query all foreign keys relationshipssql query foreign key like searcht sql list fksql server find foreign key references by columnhow to get foreign key references in sqlmssql get foreign keys for tablehow to find the foreign key reference table in sql serverselect foreign key sql serversql server find all foreign keys that reference a column