When you need to crack the foreign key constraint, you need to know the foreign key name. Two attempts in SQL server 2005 can be used: a) sys. foreign_key_columns B) sys. foreign_keys
Query the foreign key in the current database using SQL and query it together with the reference table:
Select Central. name, Central. object_id, Central. parent_object_id, Central. type_desc,
Cns. referenced_object_id, obj. name
From sys. foreign_keys cns
Left join sys. all_objects obj
On cns. referenced_object_id = obj. object_id;
Check the primary table and sub-table together by the way:
Select Central. name, Central. object_id, Central. parent_object_id, par_obj.name as parent_object_name, Central. type_desc,
Cns. referenced_object_id, obj. name
From sys. foreign_keys cns
Left join sys. all_objects obj
On cns. referenced_object_id = obj. object_id
Left join sys. all_objects par_obj
On cns. parent_object_id = par_obj.object_id
Alter table capitalhistory
Drop constraint R_1;