无法从OLE DB提供程序“批量"获取行.用于链接服务器“(null)" [英] Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)"
问题描述
我尝试从大小为1.4 GB的.csv文件中加载大量数据.但是,当我尝试运行我的代码时,会出现错误.
I try to load my database with tons of data from a .csv file sized 1.4 GB. But when I try to run my code I get errors.
这是我的代码:
USE [Intradata NYSE]
GO
CREATE TABLE CSVTest1
(Ticker varchar(10) NULL,
dateval date NULL,
timevale time(0) NULL,
Openval varchar(10) NULL,
Highval varchar(10) NULL,
Lowval varchar(10) NULL,
Closeval varchar(10) NULL,
Volume varchar(10) NULL
)
GO
BULK
INSERT CSVTest1
FROM 'c:\intramerge.csv'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
GO
--Check the content of the table.
SELECT *
FROM CSVTest1
GO
--Drop the table to clean up database.
DROP TABLE CSVTest1
GO
我尝试建立一个包含大量股票报价的数据库.但我收到此错误消息:
I try to build a database with lots of stockquotes. But I get this error message:
消息4832,级别16,状态1,第2行大容量负载:意外结束 数据文件中遇到文件.讯息7399,等级16,状态1, 第2行报告了链接服务器(null)"的OLE DB提供程序"BULK" 一个错误.提供者未提供有关以下内容的任何信息 错误.消息7330,级别16,状态2,第2行无法从中获取行 链接服务器(null)"的OLE DB提供程序"BULK"
Msg 4832, Level 16, State 1, Line 2 Bulk load: An unexpected end of file was encountered in the data file. Msg 7399, Level 16, State 1, Line 2 The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error. Msg 7330, Level 16, State 2, Line 2 Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)"
我对SQL不太了解,但是我希望抓住一两个问题.希望有人看到可能很明显的东西.
I do not understand much of SQL, but I hope to catch a thing or two. Hope someone see what might be very obvious.
推荐答案
重提一个旧问题,但以防万一这对其他人有帮助:经过反复试验,我终于(终于可以!)摆脱了这个问题通过更改此错误:
Resurrecting an old question, but in case this helps someone else: after much trial-and-error I was finally (finally!) able to get rid of this error by changing this:
ROWTERMINATOR = '\n'
对此:
ROWTERMINATOR = '0x0A'
这篇关于无法从OLE DB提供程序“批量"获取行.用于链接服务器“(null)"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!