• Very impressive Chris, thanks for sharing this!

    Regarding "... not naming stored procedures with the sp_ prefix ..." I have also, on rare occasion, placed administrative/maintenance stored procedures in the master database so that they can be called on user databases. However, I use two underscores, for example sp__whyamihere, to avoid collision with current or future stored procedures provided by Microsoft.