Auto import csv files into SQL Management Studio database

Cartoonjazz 1 Reputation point
2021-06-23T15:42:00.927+00:00

We need to generate reports based on SQL queries that use multiple csv files(tables) in SQL Management Studio. This task will have to be done weekly with updated info.

We are looking for some method where we can place updated csv flat files in a folder skipping the step of having to import the tables weekly. The csv file names and data structure will not change from week to week.

If there is a way to do this or is there an alternate program or process that you would recommend ?

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,702 questions
SQL Server Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Guoxiong 8,206 Reputation points
    2021-06-23T17:26:34.937+00:00

    You can create an SSIS package to loop the folder to import data from csv files to the database tables. After the package is created, you can create an SQL job and schedule to run the job weekly.

    1 person found this answer helpful.
    0 comments No comments

  2. ZoeHui-MSFT 41,491 Reputation points
    2021-06-24T02:01:38.087+00:00

    Hi @Cartoonjazz ,

    Just add some information based on GuoxiongYuan's reply.

    Here is a detailed blog about loop through Flat Files in SQL Server Integration Services for your reference.

    And then you may schedule the job to do this week to week.

    sql-server-agent-jobs-for-packages

    Regards,

    Zoe


    If the answer is helpful, please click "Accept Answer" and upvote it.

    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.
    Hot issues October

    1 person found this answer helpful.
    0 comments No comments

Your answer

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