Re: Deleting empty Survey Events
I have a large number of empty survey_events and samples caused by a MapMate import.
Using the 'Del4 Delete Samples with no Occurrences' batch update works fine to delete all the offending samples, but 'Del3 Delete Evens with No Samples' fails with the following error:
"There is an error in the SQL code. The error message is: 'The DELETE statement conflicted with the REFERENCE constraint "FK_SAMPLE_RECORDER_SURVEY_EVENT_RECORDER". The conflict occurred in database "NBNData", table "dbo.SAMPLE_RECORDER", column 'SE_RECORDER_KEY"
Most of the Events can be deletes by hand - time consuming, but possible, however a significant number cannot even be deleted via the route - they give the error on trying to delete:
"The record cannot be deleted because it has records linked to it."
I have checked:
SAMPLE
SURVEY_EVENT_OWNER
SURVEY_EVENT_SOURCES
These all have no linked records
SURVEY_EVENT_RECORDER does have linked records, but it has in cases when the delete is possible
SAMPLE_RECORDER is the culprit - it still has a recorder which is linked to one of the SURVEY_EVENT_RECORDER records, hence this is preventing the deletion - deleting these records in Access does cure the problem, but is both VERY time consuming AND liable to corrupt Recorder if I accidentally delete the wrong row!
HELP!
Staffordshire Ecological Record