Create a scheduled job for running the stored procedure

To automatically clean up the EVENT table at regular intervals, you can create a job at the SQL Server. The job can be created with the script ScheduledShrinkEventTable_install.sql or using the SQL Enterprise Manager.

Note: The scheduled job does not work on SQL Express databases. For the job to be executed, the SQL Server Agent has to be running. As there is no SQL Server Agent on SQL Server Express installations jobs are in this case not supported.
Note: Besides the example values stated above, you can define a number of different schedule options with sp_add-jobschedule. For example, the job can be run every two minutes or only once per week. For further information, see the Microsoft Transact SQL Documentation.