• I changed a few references to @DBName to quotename(@DBName) as there is an issue with database names with spaces.

    Otherwise, thanks very much.