DROP -> SELECT INTO V.S. TRUNCATE -> INSERT INTO
0
votes
1
answer
97
views
I have multiple temporary tables stored in the
schema for an SSIS pipeline that runs daily. The pipeline extracts data from multiple tables and stores it in the temp tables, which the data of the temp tables is later used to store in a different database.
My question is about the performance of the creation and deletion of the temp table, I want to know which approach is more optimal. Which of the following approaches is the better option? And what are the disadvantages and advantages of each one?
1-
temp table if it doesn't already exist -->
temp table from previous data before inserting new data -->
the new data into temp table.
2-
temp table if it exists --> use the statement INTO
to insert data directly without creating a temp table in a separate statement.
edit: the tables in the tempdb are created like this TABLE tempdb..Table1
Asked by Zaid Allawanseh
(3 rep)
Jun 2, 2025, 07:01 AM
Last activity: Jun 2, 2025, 02:00 PM
Last activity: Jun 2, 2025, 02:00 PM