将大型delimitel文本平面文件导入SQL Server的解决方案

时间:2015-11-14 12:25:08

标签: sql-server import overflow flat-file sql-import-wizard

我将使用“导入和导出向导”将30 GB分隔的文本文件导入SQL Server。分隔的字符是| (管道) 我已经在互联网上的每个地方搜索但还没有解决方案。有一些问题与我相同,但没有确切的错误信息:

- 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 Server,但行数约为300,000,000条记录!

我认为问题出在SQL Server导入和导出向导的初始导入对话框设置中。我感谢您提出的任何解决方案。

感谢。

2 个答案:

答案 0 :(得分:1)

我个人可能会编写一个Console应用程序来逐行读取文件,并且每X千行执行一次批量复制。该程序可以记录其进度,以便如果在文件中途发生错误,您可以解决问题并继续处理,而无需从头开始。这是一个非常简单的程序,所以你可以很快地把东西拼凑起来。

答案 1 :(得分:0)

如果您没有访问行分隔符,则可以收到列{column}的列数据溢出磁盘I / O缓冲区。例如,如果您的行分隔符设置为{CR} {LF},但文件的每一行仅以{LF}结尾,则SSIS将尝试将整个文件作为单行读取!