Load excel data into existing SQL Server table

ShamK 21 Reputation points
2021-01-11T07:18:39.72+00:00

Hi,

Can someone please suggest a way to load below excel data into existing SQL Server table. The format of the excel is different to the table columns as shown below.

TIA for your help.

Excel:

55074-image.png

Existing Table in SQL Server (13.0.5850.14):

55232-image.png

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

4 answers

Sort by: Most helpful
  1. Olaf Helper 47,436 Reputation points
    2021-01-11T09:03:43.487+00:00

    You can use a SSIS = "Integration Services" package with a Unpivot transformation to get the data in the required format.

    1 person found this answer helpful.
    0 comments No comments

  2. Oscar Maqueda 611 Reputation points Microsoft Employee
    2021-01-11T08:15:17.493+00:00

    Hi Shamk I´ve found this https://stackoverflow.com/questions/39610133/how-to-import-an-excel-file-into-sql-server don´t know if it can be useful to you.

    0 comments No comments

  3. Monalv-MSFT 5,926 Reputation points
    2021-01-12T09:41:37.667+00:00

    Hi @ShamK ,

    1.We can use Unpivot Transformation in SSIS package.
    Please refer to the following pictures:
    55704-df.png
    55678-excelsou.png
    55705-unpivot.png
    55597-unpivotoutput.png

    2.May I know which columns in Unpivot Output do you want to load into the existing table?

    Best Regards,
    Mona


    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.


  4. natig gurbanov 1 Reputation point
    2021-01-12T10:48:11.377+00:00
    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.