>Is there a way to have a Common Table Expression valid for more than one command in the script? Presently, I have to repeat the same command again, later down the script, so it would be available for other commands.
You would need to select into a temp table or table variable.
If it's not broken, fix it until it is.
My Blog