On some of the websites I work on the table OpenWebStudio_Repository has a tendency to grow out of proportion.
I have been testing a clean up function, and it works for me
Wanted to share it.
First I create a view "a_OWS_Repository_configurations_in_use" that displays configurations that are actually in use at the moment
FROM OpenWebStudio_Repository AS t1 LEFT JOIN OpenWebStudio_Repository AS t2
ON (t1.ConfigurationID = t2.ConfigurationID AND t1.Date < t2.Date)
WHERE t2.Date IS NULL
Order by ConfigurationID
then I just run
delete FROM [dbo].[OpenWebStudio_Repository]
where RepositoryID not in (
Hope this helps anyone needing it