Database Cleanup — SQL Express

SQL Express has a built-in 10 GB database limit. If a larger database is needed, a standalone SQL server is recommended. If the database is not needed to be stored, a script can be used to reduce the size when needed.

Reduce database

  1. Install SQL Express Management tool from Microsoft.

  2. Run this SQL query to remove everything that is older than 90 days:

    $ DELETE dbo.authn WHERE AuthenticationDate<GETDATE()-90
    $ DELETE dbo.authz WHERE AuthorizationDate<GETDATE()-90

This can also be set as a scheduled task.