Topic: Deleting records
Does anyone have a batch update which will delete all records imported into a Recorder 6 survey on a specific day? The survey as a lot of other records entered on earlier occasions which I want to keep.
Thanks
The technical forum of the NBN Trust for use by the Network. It includes discussions and announcements on the NBN Atlas, Recorder 6 and Indicia |
You are not logged in. Please login or register.
Forum → How Do I... & Other Questions → Deleting records
Does anyone have a batch update which will delete all records imported into a Recorder 6 survey on a specific day? The survey as a lot of other records entered on earlier occasions which I want to keep.
Thanks
The attached template is based on Batch Update JNCCDel5. It requires the Survey key and the entry_date to be changed to the appropriate key/date as required.
That is change LC00000100000003 to the appropriate survey key and 2014-03-27 to the appropriate date in the WHERE clause.
where Sv.Survey_Key = 'LC00000100000003' AND Datediff(d,TOCC.Entry_Date,'2014-03-27') = 0
Please take a backup and check the results carefully.
Mike,
I've tried this having made the appropriate changes and get the following message:
There is an error in the SQL code. The error message is: 'The DELETE statement conflicted with the REFERENCE constraint "FK_SURVEY_EVENT_SURVEY". The conflict occured in the database "NBNData", table "dbo.SURVEY_EVENT", column 'SURVEY_KEY"
What do I do next?
Thanks, Andy
Will take a look and get back to you. The update shouldn't be trying to delete the Survey and can't think why it is.
Just to say, I haven't forgotten about this and I am still working it.
Mike I have managed to delete the data by moving the records into a new empty survey as described in this link: http://forums.nbn.org.uk/viewtopic.php? … 47#p19447. I then then deleted the survey using the batch update JNCC Del5records. This works because all the records that I wanted to delete from the original survey were from one single year and the survey contained no other data for that year. Thanks for your help.
Forum → How Do I... & Other Questions → Deleting records
Powered by PunBB 1.4.6, supported by Informer Technologies, Inc.