Get the Foreign Key constraint name

If Foreign Key constraints doesn’t have any fixed names and you need the names dynamically through the SQL Query, which may be useful for deployment point of view. They can be obtained as follows: SELECT FK_TableĀ  = FK.TABLE_NAME, FK_Column = CU.COLUMN_NAME, PK_TableĀ  = PK.TABLE_NAME, PK_Column = PT.COLUMN_NAME, Constraint_Name = C.CONSTRAINT_NAME FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS C INNER JOIN… Read More Get the Foreign Key constraint name