• Thanks for the article. I had to do a similar thing for our development and test environment. We have two databases in production that have views that point to the other database. Therefore, if we wanted to run 2 separate copies of these databases, we'd run into hardcoded names in the procedural code. So I wrote a similar script to make the changes.

    FYI, I used the Sys.Sql_Modules catalog view instead of sp_helptext.