• 1st of all - my query DOES NOT return an error.

    Try before you say.

    2nd, if I would include new table into my solution I would separate CREATE TABLE statement from the solution and prefix it with NOT EXIST check.

    By the way, my solution takes less than 3ms. At least SQL Server cannot catch that time interval.

    _____________
    Code for TallyGenerator