/* Event-Add_Death.sql 2013-01-16 Tom Holden ve3meo Adds a dead event to all dead people lacking one. Nor date, place, description or note is added. */ ; INSERT INTO EventTable SELECT NULL AS EventID ,2 AS EventType ,0 AS OwnerType ,PersonID AS OwnerID ,0 AS FamilyID ,0 AS PlaceID ,0 AS SiteID ,'.' AS DATE ,9223372036854775807 AS SortDate ,0 AS IsPrimary ,0 AS IsPrivate ,0 AS Proof ,0 AS STATUS ,0 AS EditDate ,CAST('' AS BLOB) AS Sentence ,CAST('' AS BLOB) AS Details ,'' AS Note FROM PersonTable WHERE PersonID IN ( -- Person without Dead Fact SELECT distinct PersonID AS PersonID FROM PersonTable WHERE Living = 0 except select OwnerID as PersonID from EventTable where EventType=2 );
I started from this query but added a death year with an 'about' and an * as a suffix. I know that anyone with * has unreliable dates (not proven) and I can therefore quickly know if a new person from another source could match an existing one.