有没有办法将数据从多个Excel文件导入到SQL Server?

huangapple go评论73阅读模式
英文:

Is there a way to import data from multiple excel files into SQL Server?

问题

我有一堆在文件夹中的Excel文件(带有表格),我想要导入到SQL Server中。
是否可以在SQL中编写一个循环或一些代码,以便访问文件路径,打开文件并将数据导入到表格中?
(我有每个州的数据,因此打开50个表格将会很繁琐,我希望避免这样做。)

英文:

I have a bunch of excel files (with tables) in a folder that I want to import into SQL Server.
Is there a loop or some code that I can write in SQL that will go to file path, open the file and import the data into the table?
(I have data for each state so opening 50 tables will be tedious and I am looking to avoid doing so.)

答案1

得分: 2

你可以使用Power Query for Excel将工作簿合并成一个单一的工作簿,然后将其加载到SQL Server中。

英文:

You can use Power Query for Excel to combine the workbooks into a single workbook, and then load that into SQL Server.

huangapple
  • 本文由 发表于 2020年1月4日 01:47:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/59583074.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定