• 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 🙂

    ---------------
    Mel. 😎