sql server get foreign key tables code example Example: tsql find foreign key references EXEC sp_fkeys 'TableName'