Load Daily data into Temp Table or View

San 161 Reputation points
2024-02-28T11:18:05.7033333+00:00

Dear Experts, My SSIS package creates a table daily. (TableName_Feb_27_2021_1104PM_Import). I want to store this table data in a View or temp table. Let's say tomorrow if I get the table name (TableName_Feb_28_2021_1104PM_Import). Then I need to truncate the View or temp table and load the Feb28th data

SQL Server | Other
0 comments No comments
{count} votes

Answer accepted by question author
  1. LiHongMSFT-4306 31,611 Reputation points
    2024-02-29T02:03:26.12+00:00

    Hi @San

    Then I need to truncate the View or temp table and load the Feb28th data。

    In my opinion, this is redundant. Why not just query data from the TableName_Feb_28_2021_1104PM_Import table?

    Best regards,

    Cosmog Hong


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Olaf Helper 47,581 Reputation points
    2024-02-28T11:44:52.4266667+00:00

    A temp table gets automatically droped as soon the connection close and a view is "only" a prfined query, it can't store data. Why not using one, fix table e.g. with the timestamp of the data load?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.