To make life easier on everyone I have created a sample piece of code that you can run sql against the Callmanager database.I am putting this hear so I can find it again in the future:)It's not perfect, but tweak as you need it.
clear$scriptPath = ...