We are using WFFM 2.4 with Sitecore 7.2 and have "save to database" action in many forms.As WFFM database size is more then 21 GB now, I am looking a script to remove old records. Please share if same kind of work you have done before.
I think that it is better backup WFFM db and attach the new one clear database rather than do any manipulations with old data. But in case if you wish to do it, here is script:
DELETE FROM Field WHERE FormId in (select Id from Form where Timestamp < '2018/06/15') GO DELETE FROM Form WHERE Id in (select Id from Form where Timestamp < '2018/06/15')
Put date that you require instead of '2018/06/15' and don't forget to backup before running it.