/* DummyFamily-Delete.sql
Reverses the changes made by DummyFamily-Add.sql to the FamilyTable.

After completing the report, run DummyFamily-Delete.sql; it is probably less risky, however,
to run the first query and report on a copy of the database and then delete the copy.
2012-01-15 ve3meo
*/
 
DELETE FROM FamilyTable
WHERE
 FatherID 
 IN
  (
   SELECT FatherID FROM FamilyTable
   WHERE
    CASE 
     WHEN @RIN NOT LIKE '' THEN FatherID = @RIN
     ELSE 1
    END  
   AND
    MotherID IS NULL 
   AND
    ChildID IS NULL
  )  
;
