将巨大的定界文本平面文件导入 SQL 服务器的解决方案
Solution to Import Huge delimitel text Flat File into SQL Server
我将使用导入和导出向导将一个 30 GB 的分隔文本文件导入 SQL 服务器。分隔符是 | (管道)
我已经在互联网上的每个地方都进行了搜索,但还没有解决方案。有一些问题和我一样,但不是确切的错误信息:
- Executing (Error)
Messages
Error 0xc020209c: Data Flow Task 1: The column data for column "Username" overflowed the disk I/O buffer.
(SQL Server Import and Export Wizard)
Error 0xc0202091: Data Flow Task 1: An error occurred while skipping data rows.
(SQL Server Import and Export Wizard)
Error 0xc0047038: Data Flow Task 1: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.
The PrimeOutput method on component "Source - Sessions_txt" (1) returned error code 0xC0202091.
The component returned a failure code when the pipeline engine called PrimeOutput().
The meaning of the failure code is defined by the component,
but the error is fatal and the pipeline stopped executing.
There may be error messages posted before this with more information about the failure.
(SQL Server Import and Export Wizard)
我尝试先将其导入到excel文件,然后将excel文件导入到SQL服务器,但行数约为300,000,000条记录!
我认为问题出在 SQL 服务器导入和导出向导中的初始导入对话框设置中。感谢您提出的任何解决方案。
谢谢。
我个人可能会编写一个控制台应用程序来逐行读取文件并每 X 千行执行一次批量复制。该程序可以记录其进度,以便如果文件中途发生错误,您可以解决问题并再次继续处理,而无需从头开始。这是一个编写起来非常简单的程序,因此您可以非常快速地组合一些东西。
如果您没有命中行定界符,您会收到第 {column} 列的列数据溢出磁盘 I/O 缓冲区。例如,如果您的行分隔符设置为 {CR}{LF} 但文件的每一行仅以 {LF} 结尾,则 SSIS 将尝试将整个文件作为一行读取!
我将使用导入和导出向导将一个 30 GB 的分隔文本文件导入 SQL 服务器。分隔符是 | (管道) 我已经在互联网上的每个地方都进行了搜索,但还没有解决方案。有一些问题和我一样,但不是确切的错误信息:
- Executing (Error)
Messages
Error 0xc020209c: Data Flow Task 1: The column data for column "Username" overflowed the disk I/O buffer.
(SQL Server Import and Export Wizard)
Error 0xc0202091: Data Flow Task 1: An error occurred while skipping data rows.
(SQL Server Import and Export Wizard)
Error 0xc0047038: Data Flow Task 1: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.
The PrimeOutput method on component "Source - Sessions_txt" (1) returned error code 0xC0202091.
The component returned a failure code when the pipeline engine called PrimeOutput().
The meaning of the failure code is defined by the component,
but the error is fatal and the pipeline stopped executing.
There may be error messages posted before this with more information about the failure.
(SQL Server Import and Export Wizard)
我尝试先将其导入到excel文件,然后将excel文件导入到SQL服务器,但行数约为300,000,000条记录!
我认为问题出在 SQL 服务器导入和导出向导中的初始导入对话框设置中。感谢您提出的任何解决方案。
谢谢。
我个人可能会编写一个控制台应用程序来逐行读取文件并每 X 千行执行一次批量复制。该程序可以记录其进度,以便如果文件中途发生错误,您可以解决问题并再次继续处理,而无需从头开始。这是一个编写起来非常简单的程序,因此您可以非常快速地组合一些东西。
如果您没有命中行定界符,您会收到第 {column} 列的列数据溢出磁盘 I/O 缓冲区。例如,如果您的行分隔符设置为 {CR}{LF} 但文件的每一行仅以 {LF} 结尾,则 SSIS 将尝试将整个文件作为一行读取!