意外的EOF BCP中遇到 [英] Unexpected EOF encountered in BCP

查看:768
本文介绍了意外的EOF BCP中遇到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试将数据导入到Azure上。
在Management Studio 2005中创建一个文本文件。
我曾尝试既是一个逗号和制表符分隔文本文件。

Trying to import data into Azure. Created a text file in Management Studio 2005. I have tried both a comma and tab delimited text file.

BCP IN -c -t,-r \\ n -U -S -P
我得到的错误{SQL服务器本机客户端11.0]意外结束在BCP数据文件中遇到

BCP IN -c -t, -r\n -U -S -P I get the error {SQL Server Native Client 11.0]Unexpected EOF encountered in BCP data file

下面是我用来创建该文件的脚本:

Here is the script I used to create the file:

 SELECT top 10  [Id]
      ,[RecordId]
      ,[PracticeId]
      ,[MonthEndId]
      ,ISNULL(CAST(InvoiceItemId AS VARCHAR(50)),'') AS InvoiceItemId
      ,[Date]
      ,[Number]
      ,[RecordTypeId]
      ,[LedgerTypeId]
      ,[TargetLedgerTypeId]
      ,ISNULL(CAST(Tax1Id as varchar(50)),'')AS Tax1Id
      ,[Tax1Exempt]
      ,[Tax1Total]
      ,[Tax1Exemption]
      ,ISNULL(CAST([Tax2Id] AS VARCHAR(50)),'') AS Tax2Id
      ,[Tax2Exempt]
      ,[Tax2Total]
      ,[Tax2Exemption]
      ,[TotalTaxable]
      ,[TotalTax]
      ,[TotalWithTax]
      ,[Unassigned]
      ,ISNULL(CAST([ReversingTypeId] AS VARCHAR(50)),'') AS ReversingTypeId
      ,[IncludeAccrualDoctor]
      ,12 AS InstanceId
  FROM <table>

下面是表它被插入

CREATE TABLE [WS].[ARFinancialRecord](
    [Id] [uniqueidentifier] NOT NULL,
    [RecordId] [uniqueidentifier] NOT NULL,
    [PracticeId] [uniqueidentifier] NOT NULL,
    [MonthEndId] [uniqueidentifier] NOT NULL,
    [InvoiceItemId] [uniqueidentifier] NULL,
    [Date] [smalldatetime] NOT NULL,
    [Number] [varchar](17) NOT NULL,
    [RecordTypeId] [tinyint] NOT NULL,
    [LedgerTypeId] [tinyint] NOT NULL,
    [TargetLedgerTypeId] [tinyint] NOT NULL,
    [Tax1Id] [uniqueidentifier] NULL,
    [Tax1Exempt] [bit] NOT NULL,
    [Tax1Total] [decimal](30, 8) NOT NULL,
    [Tax1Exemption] [decimal](30, 8) NOT NULL,
    [Tax2Id] [uniqueidentifier] NULL,
    [Tax2Exempt] [bit] NOT NULL,
    [Tax2Total] [decimal](30, 8) NOT NULL,
    [Tax2Exemption] [decimal](30, 8) NOT NULL,
    [TotalTaxable] [decimal](30, 8) NOT NULL,
    [TotalTax] [decimal](30, 8) NOT NULL,
    [TotalWithTax] [decimal](30, 8) NOT NULL,
    [Unassigned] [decimal](30, 8) NOT NULL,
    [ReversingTypeId] [tinyint] NULL,
    [IncludeAccrualDoctor] [bit] NOT NULL,
    [InstanceId] [tinyint] NOT NULL,
 CONSTRAINT [PK_ARFinancialRecord] PRIMARY KEY CLUSTERED 
(
    [Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)

其实有几十万的实际记录,我已经这样做了,从不同的服务器,唯一的区别是管理工作室的版本。

There are actually several hundred thousand actual records and I have done this from a different server, the only difference being the version of management studio.

推荐答案

如果该文件是制表符分隔则列分隔符的命令行标志应为 -t \\ t -t,

If the file is tab-delimited then the command line flag for the column separator should be -t\t -t,

这篇关于意外的EOF BCP中遇到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆