I have a relation called Friends
with the following columns,
User1ID
User2ID
Since
User1ID
and User2ID
are a set of primary keys in the relation. They are also foreign keys referencing to the table Users. Now i want to add an ON CASCADE DELETE
, such that when a user from table Users is deleted then the corresponding row from table Friends
is deleted as well. However, MS SQL Server does not allow me to add that constraint.
Any ideas, about how can i modify the table, in order to accomplish that task?