Tree imported from Ancestry.com via Family Tree Maker 2012 has phantom spouses. “Phantom” in this case defined as being unnamed, not existing in the PersonTable (i.e. PersonID=0) and childless. Yet they count in RootsMagic Find “Number of spouses” criterion and may cause other unwanted behaviour.
To find persons having such a phantom spouse:
SELECT FamilyID, FatherID, MotherID FROM FamilyTable WHERE FamilyID IN ( SELECT FamilyID FROM FamilyTable WHERE FatherID=0 OR MotherID=0 EXCEPT SELECT FamilyID FROM ChildTable ) ;
Use the FatherID or MotherID to look up in RM the person with that record number. You can then unlink the spouse one at a time.
To delete all such phantom spouses in one shot (actually deletes the family which is tantamount to the same thing as unlinking the spouse):
DELETE FROM FamilyTable WHERE FamilyID IN ( SELECT FamilyID FROM FamilyTable WHERE FatherID=0 OR MotherID=0 EXCEPT SELECT FamilyID FROM ChildTable ) ;