Approval Data Retention
Resolved approval requests accumulate in the database over time. The Approval Data Retention setting controls how long completed requests are kept before they are automatically deleted.
Access: Settings → General Settings → Retention tab → Approval Data Retention
What gets deleted:
Only requests with a terminal status are eligible for cleanup:
- Approved — changes were accepted and committed to live data
- Rejected — changes were declined
- Returned — changes were sent back to the submitter for revision
- Cancelled — request was withdrawn by the submitter
Pending requests are never deleted automatically — they are still awaiting a decision and must be handled manually.
Configuration options:
| Setting | Effect |
|---|---|
| 0 (Never) | Cleanup is disabled. All approval history is kept indefinitely. |
| 90 days | Resolved requests older than 90 days are removed |
| 180 days | Resolved requests older than 180 days are removed |
| 1 year (default) | Resolved requests older than 365 days are removed |
| 2 years | Resolved requests older than 730 days are removed |
| Custom value | Any number of days (1–9999) |
How cleanup works:
A SQL Server Agent job runs usp_Maintenance_Cleanup periodically (default: every 60 seconds). This stored procedure reads approvalRetentionDays from the AppSettings table and calls usp_Approval_Cleanup with that value.
Three tables are cleaned up in a single operation:
ApprovalRequests— the parent record (one per submission)ApprovalRows— the individual row changes within the request (cascade deleted)ApprovalReviews— the approver decisions and comments (cascade deleted)
When records are actually deleted, the result is logged to the SchedulerLog table with event type cleanup. No-op runs (where nothing was deleted) are not logged.
Warning banner:
The settings card shows an orange warning banner when retention > 0, indicating the cutoff date: *"All resolved requests before 26 February 2025 will be removed."* This updates live as you change the value. When set to 0 (Never), a blue info banner shows instead: *"Approval records are kept indefinitely."*