• As pointed out above, using SELECT INTO will not copy over any of your indexes or keys nor permissions. You'll need to capture all of them and recreate them on the new tables. You need to make sure that table insert/updates are not being performed between your table copy and then when you do your rename, otherwise, you've lost data.

    Honestly, I would be very hesitant to run any process that drops all of my tables without very good error handling. You'd want to confirm that the new table was created successfully and the record counts match before dropping the originals. This whole process is not something you should run during production hours nor without extensive testing. A typo in your scripting could have you drop a table that you didn't create a copy on. Very risky.

    MWise