Crap. Sorry am being stupid. Ignore my previous post.
Anyways, I am hoping to use your script as a starting point to prevent circa 400+ tables from being dropped. I have tried a few things but I am not how to pass the table values to @oname?
Any ideas appreciated. Thanks.