Querying FATTACH table - bulk delete attachments
We built up a backlog of file attachments, but we're at the point now where we want to bulk delete the existing backlog of files attached to incidents, and then to run a regular deletion process following that to delete any file attachment created more than xx days ago.
We can query the incident table, look to see if there are attachments, call up the information that way and delete as we go. The problem is that we have to look at every incident to see if it HAS an attachment.
The ideal method would be to directly query the FATTACH table, check the date, and delete the files that way.