• We have to do something very similar, and I like some aspects of the OP's approach, but I'd like to share some experience, having done it daily for the last five years or so:-

    - The word "CREATE" can occur in a lot of places, so you have to make sure that you replace "CREATE PROC" with "ALTER PROC".

    - Because there can be an arbitrary number of spaces between CREATE and PROC, you have to use another fine tip from this very site to quickly reduce CREATE(\s+?)PROC to CREATE\sPROC (to use a regexpism).

    - If you have RENAMED the stored procedure, then you have to be careful to re-execute the stored procedure using the NEW name, not the old. SQL Server does some funky re-writing in this case.

    - Unless you are careful to script them out, the "SET" lines at the top and tail of the Procedure will be lost, so doing this can chance the ANSI_NULLS and other settings that were present when the SP was first created.

    - General Note: There's an obvious problem with replacing common text. You could easily shred your Db by putting in the replacing of "CREATE" with "ALTER" across the board.... @CreatedDate would become @AlterdDate for example... So, try it out on a test Db first!

    Hope this helps,

    N.