>I try to always create my select statements with the database on them, I think I never use the USE statement.
Yes, this generates well when the database name is known at the time I generate the script. But, in that particular case, the user will adjust the DatabaseName variable in the script before executing it. So, I do not want to change thousands of lines so to have them to be executed as a command with the EXECUTE() comand.