简体   繁体   English

使用 SSIS 将巨大的 excel (xlsx) 导入 SQL Server

[英]Importing huge excel (xlsx) into SQL Server using SSIS

I have excel file about 300MB+ in size.我有大约 300MB+ 的 excel 文件。 When I tried loading it with conventional excel source and SQL destination it keep on spinning.当我尝试使用传统的 excel 源和 SQL 目标加载它时,它继续旋转。 Not loaded even a row.连一排都没装。

Is there any way to load huge excel file to SQL Server using SSIS?有没有办法使用 SSIS 将巨大的 excel 文件加载到 SQL Server? possible to reduce into small chunks (batch processing) ?可以减少成小块(批处理)?

Wow, that is a HUGE Excel file.哇,这是一个巨大的 Excel 文件。 I didn't know that you could actually save a file that big.我不知道您实际上可以保存这么大的文件。 Anyway, if I were you, I would convert it to .xlsb, which is binary, and may be as small as 1/4 the size of a .xlsx file.不管怎样,如果我是你,我会把它转换成 .xlsb,它是二进制文件,可能只有 .xlsx 文件大小的 1/4。 Or, save it as a cvs file, and load the csv into SQL Server.或者,将其另存为 cvs 文件,然后将 csv 加载到 SQL Server 中。 You can bulk insert a csv file into SLQ Seerver very easily using a concept like this.您可以使用这样的概念非常轻松地将 csv 文件批量插入 SLQ Seerver。

BULK
INSERT CSVTest
FROM 'c:\csvtest.txt'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
GO
--Check the content of the table.
SELECT *
FROM CSVTest
GO
--Drop the table to clean up database.
DROP TABLE CSVTest
GO

See the links below for a few ideas of how to do this.有关如何执行此操作的一些想法,请参阅下面的链接。

https://archive.is/RATG#selection-443.0-561.3 https://archive.is/RATG#selection-443.0-561.3

https://blog.sqlauthority.com/2012/06/20/sql-server-importing-csv-file-into-database-sql-in-sixty-seconds-018-video/ https://blog.sqlauthority.com/2012/06/20/sql-server-importing-csv-file-into-database-sql-in-sixty-seconds-018-video/

https://blog.sqlauthority.com/2011/11/02/sql-server-import-csv-into-database-transferring-file-content-into-a-database-table-using-csvexpress/ https://blog.sqlauthority.com/2011/11/02/sql-server-import-csv-into-database-transferring-file-content-into-a-database-table-using-csvexpress/

https://blog.sqlauthority.com/2011/05/12/sql-server-import-csv-file-into-database-table-using-ssis/ https://blog.sqlauthority.com/2011/05/12/sql-server-import-csv-file-into-database-table-using-ssis/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM