• quoteIn the real world I have some issues with object renaming. I have seeing the cases where after renaming an object and creating another one with the same name some applications start erroring with message that it can't find an object (even I can see it and work with it in Query Analyzer). Personally, I do avoid renaming in production databases.

    Per BOL..."Important  After renaming stored procedures and views, flush the procedure cache to ensure all dependent stored procedures and views are recompiled."

    Notice the "DBCC FREEPROCCACHE" at the end of the rename script.

    On another topic, I noticed you didn't comment on the different while loop.  What do you think about using a break instead of min and max variables?  If you check the optimizer it's definitely more efficient.

    Signature is NULL