Save Excel sheet in SQL

In Excel there is a panel of the "Get External Data" ribbon on the "Data" tab, where we can choose to import tables from SQL databases. This process was pleasant for me. But my question is: is there a way to store this data in SQL? Does Excel provide any API that makes it easy to code such a function indiscriminately and do it from scratch?

thanks

+4
source share
3 answers

It may not be the solution you are looking for, but for a long time I returned the VBA code that would take the range in Excel and convert it to XML and create SQL to put this data in the temp table in SQL Server. Here is a link if you are interested.

+1
source

The easiest way to do this is to use the import function in SSMS. You can choose which sheets to use, configure column mappings, etc. If SSIS is created, you can then manipulate further if necessary. However, this approach is a traction from Sql, not a click on Excel, if you want to do this, you will have to code some VBA to do it for you.

0
source

Source: https://habr.com/ru/post/1314295/


All Articles