Dynamic Load of Excel and csv to Sql server

Viewed 1391

I would like load the huge excel and csv files data into SQL server dynamically based on configuration in database table. Each file will be different from another and it should load into table dynamically, Please provide the best way to achieve it?

I have tried with ssis but for excel ssis will determine the column datatype based on first 8 rows, Because of that it causing issue.

2 Answers

C# solution

Recently i started a new project on Git-Hub, which is a class library developed using C#. You can use it to import tabular data from excel, word , powerpoint, text, csv, html, json and xml into SQL server table with a different schema definition using schema mapping approach. check it out at:

You can follow this Wiki page for a step-by-step guide:


SSIS Solution

If you are looking to use SSIS you can refer to my answer on the following topic:

In Excel, format all the troublesome cells as Text; all columns are formatted as General by default. Now, save your changes are re-try. You should get what you are after. See this link for all details.

Related