how to find table name from foreign key in sql server code example Example: tsql find foreign key references EXEC sp_fkeys 'TableName'