Delete data with foreign key in SQL Server table
- by Andha
I'm going to delete data in an SQL Server table (parent) which has a relationship with another table (child).
I tried the basic Delete query. But it isn't working (and I know it won't).
DELETE FROM table WHERE ...
It returned following error
The DELETE statement conflicted with the REFERENCE constraint ...
I need to keep the table's schema. I know that I just need to add some words in the query, I've ever done this before, but I just couldn't recall it.