• The script database name is defined for 50 chars. Your db names are longer so you will need to increase it. You may also have to enclose the DB name in brackets.

    ,@vcDatabaseNameVARCHAR(50)