SqlMel (8/13/2014)
It's a good question. Learned something today.Actually, if you run the script as is it will not even rename the object.
Since it is lacking a GO statement between the SELECT and the EXECUTE, the last statement just becomes part of the procedure.
At first, I wondered if that intentionally part of the actual question 🙂
Yeah, me too. But then I re-read the question and it was pretty clear.