WORK has PK WORK_ID
SYSTEM has WORK_ID but it is FK as name "ST_WRK_FK"
TASKS has WORK_ID but it is FK as name "ET_WRK_FK"
Now I want to remove records in WORK. First I delete all its child tables records associated with it
Now I turn out the following error
Msg 547, Level 16, State 0, Line 4
The DELETE statement conflicted with the REFERENCE constraint "ET_WRK_FK". The conflict occurred in database "test1", table "dbo.TASKS", column 'WORK_ID'.
The statement has been terminated.
I check the tables TASKS and SYSTEM, all the associated records are removed. I don't understand why I cannot remove records from WORK which is the parent table.
What I went wrong? How to fix this issue?
Microsoft SQL ServerMicrosoft SQL Server 2008SQL
8/22/2022 - Mon
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!