【问题标题】:I'm using a bulk insert statement using sql server 2008我正在使用使用 sql server 2008 的批量插入语句
【发布时间】:2015-11-16 12:26:38
【问题描述】:
BULK INSERT kbm_8311.dbo.cqm_mstr FROM 'D:\sanu\cqm_mstr.txt' WITH (DATAFILETYPE='native')  

我收到这样的错误消息

消息 4866,级别 16,状态 7,第 2 行批量加载失败。专栏 数据文件中第 1 行第 15 列的长度过长。验证 正确指定了字段终止符和行终止符。消息 7399, 级别 16,状态 1,第 2 行链接服务器的 OLE DB 提供程序“BULK” “(null)”报错。提供者没有提供任何信息 关于错误。消息 7330,级别 16,状态 2,行 2 无法获取 来自链接服务器“(null)”的 OLE DB 提供程序“BULK”的行。

这是我尝试用于上传的文件示例

é   MUII CMS2 (NQF0418) Percentage of patients aged 12 years and older screened for clinical depression on the date of the encounter using an age appropriate standardized depression screening tool AND if positive, a follow-up plan is documented on the date of the positive screen.T Preventive Care and Screening:  Screening for Clinical Depression and Follow-Up Plan+ Screening for Depression and Follow-Up Plan Depression Screenõ Document a depression assessment using the Screening tools template. Open health promotion plan, and document the plan of care or referral information. Enter medications via the medication module.  For adolescents, need to screen with the PHQ-9.

【问题讨论】:

  • 您知道第 15 列正在加载到哪个表字段中吗?也许你可以把它变大(即VARCHAR(MAX)),看看是否有帮助
  • 这里的问题是,我已经从该表本身创建了 BCP 文件
  • 我明白了。好吧,如果您确实将其加载到具有更宽容数据类型的不同表中,您将能够看到数据,并且可能会清楚问题所在。
  • 问题是我正在上传从同一个表创建的同一个 txt 文件;我该怎么办?
  • 直到昨天我才安全运行它;现在我遇到了一个错误

标签: sql-server sql-server-2008


【解决方案1】:

表结构已更改 显式插入 row_timestamp 会造成问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-17
    • 1970-01-01
    • 2013-10-30
    相关资源
    最近更新 更多