• How well does it run for you without the cursor? How many files are you deleting when using the cursor per database?

    I've not used this inside a cursor, I usually just strip the stored procedure extras and run it ad-hoc if I want to clean up something manually. But even then it has not run that long (20min) and I've got a slow network share drive...

    Could the slowness possibly be coming from trying to delete a lot of files over the network?

    I'm glad that it's working for you. Hopefully we/I can help figure out why it's slow on occasion...

    Gordon

    Your friendly High-Tech Janitor... 🙂