The tps_scheduled_result and tps_scheduled _result_detail tables are getting quite large. This can result in the schedules tree in the Schedule Manager component taking quite a long time to open.
On Service Desk 7.8.1 and earlier there is no automatic clear down feature for this, so the below solution will allow you to create a new Stored Procedure to clear this down.
From Service Desk 7.8.2 and newer there is an automatic clear down feature, which you can configure in the Schedule Management Component. So from 7.8.2 you no longer need this Stored Procedure.
Solution to clear this out on Service Desk 7.8.1 and earlier:
The attached script is a stored procedure that deletes schedule data that is more than a month old and has been completed. This procedure should be scheduled to run regularly in order to ensure that the tables remain at a manageable size.