I am using Northwind database and I am trying to delete the Products information from the Products table using SQL. However, when I tried to do that, it says that it can not be deleted because it is related to an another table. My problem is, when I deleted the table that was related to Products manually, it worked, but when I tried it code-wise, it is not working. How do I delete the relationship between the two tables because I just want to remove the information in the Products table? Can anyone help me on that?

Thanks in advance!

10 Years
Discussion Span
Last Post by binoj_daniel

To do this. Whenever you delete records in the table with referential integrity, you have first delete rows from the child tables and then delete the master row from the Product table, in your case.

Because of the foreign key constraint it will not allow you to delete the main record from the product table and it will leave the records related to the key field in other child tables, hence leaving orphan records.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.