英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论