sql - Unable to delete a row from a table due to a dependency/reference in another table -
I have a stored procedure that removes a record from a table, where one of the columns matches the specified value :
Alternate Processes [DBO] [Spadel Branch] @Detafield Remove from branch (50) as Brankonamam = @Detafield ed Unfortunately I get the following error:
DELETE statement is contradictory with the reference reference "fk_BranchIdDept" conflict in the database "MproWorkSpace", the table "dbo.Department", column 'branch ID'.
Can anyone explain why I see this error?
The reference to the Delei statement is contradictory with reference barrier "fk_BranchIdDept".
The record you are trying to remove is referred to in other tables; With the removal of the branch recorder, other tables will become orphans, and will give any such reference which is no longer present.
There are two approaches to this:
- Delete all records in previously referenced tables
Comments
Post a Comment