日期:2014-05-17  浏览次数:20762 次

bulk insert 大容量加载: 在数据文件中遇到意外的文件结尾
SQL code

CREATE TABLE [dbo].[TempTrans](
    [TransactionsDate] [nvarchar](max) NULL,
    [PosNumber] [nvarchar](max) NULL,
    [AccountNumber] [nvarchar](max) NULL,
    [CardNumber] [nvarchar](max) NULL,
    [TransType1] [nvarchar](max) NULL,
    [TransType2] [nvarchar](max) NULL,
    [TransType3] [nvarchar](max) NULL,
    [TransAmount] [nvarchar](max) NULL,
    [TransType4] [nvarchar](max) NULL,
    [TransType5] [nvarchar](max) NULL,
    [TransType6] [nvarchar](max) NULL,
    [TransType7] [nvarchar](max) NULL,
    [TransType8] [nvarchar](max) NULL,
    [TransType9] [nvarchar](max) NULL,
    [TransType10] [nvarchar](max) NULL,
    [TransType11] [nvarchar](max) NULL,
    [TransType12] [nvarchar](max) NULL,
    [TransType13] [nvarchar](max) NULL,
    [TransType14] [nvarchar](max) NULL,
    [TransType15] [nvarchar](max) NULL,
    [TransType16] [nvarchar](max) NULL,
    [TransType17] [nvarchar](max) NULL,
    [TransType18] [nvarchar](max) NULL,
    [TransType19] [nvarchar](max) NULL,
    [TransType20] [nvarchar](max) NULL,
    [TransType21] [nvarchar](max) NULL,
    [TransType22] [nvarchar](max) NULL,
    [TransType23] [nvarchar](max) NULL,
    [TransType24] [nvarchar](max) NULL,
    [TransType25] [nvarchar](max) NULL,
    [TransType26] [nvarchar](max) NULL,
    [TransType27] [nvarchar](max) NULL,
    [TransType28] [nvarchar](max) NULL
    
) 



test.xml
XML code

<?xml version="1.0"?>
<BCPFORMAT xmlns="http://schemas.microsoft.com/sqlserver/2004/bulkload/format" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <RECORD>
  <FIELD ID="1" xsi:type="CharTerm" TERMINATOR="\t" COLLATION="Chinese_PRC_CI_AS"/>
  <FIELD ID="2" xsi:type="CharTerm" TERMINATOR="\t" COLLATION="Chinese_PRC_CI_AS"/>
  <FIELD ID="3" xsi:type="CharTerm" TERMINATOR="\t" COLLATION="Chinese_PRC_CI_AS"/>
  <FIELD ID="4" xsi:type="CharTerm" TERMINATOR="\t" COLLATION="Chinese_PRC_CI_AS"/>
  <FIELD ID="5" xsi:type="CharTerm" TERMINATOR="\t" COLLATION="Chinese_PRC_CI_AS"/>
  <FIELD ID="6" xsi:type="CharTerm" TERMINATOR="\t" COLLATION="Chinese_PRC_CI_AS"/>
  <FIELD ID="7" xsi:type="CharTerm" TERMINATOR="\t" COLLATION="Chinese_PRC_CI_AS"/>
  <FIELD ID="8" xsi:type="CharTerm" TERMINATOR="\t" COLLATION="Chinese_PRC_CI_AS"/>
  <FIELD ID="9" xsi:type="CharTerm" TERMINATOR="\t" COLLATION="Chinese_PRC_CI_AS"/>
  <FIELD ID="10" xsi:type="CharTerm" TERMINATOR="\t" COLLATION="Chinese_PRC_CI_AS"/>
  <FIELD ID="11" xsi:type="CharTerm" TERMINATOR="\t" COLLATION="Chinese_PRC_CI_AS"/>
  <FIELD ID="12" xsi:type="CharTerm" TERMINATOR="\t" COLLATION="Chinese_PRC_CI_AS"/>
  <FIELD ID="13" xsi:type="CharTerm" TERMINATOR="\t" COLLATION="Chinese_PRC_CI_AS"/>
  <FIELD ID="14" xsi:type="CharTerm" TERMINATOR="\t" COLLATION="Chinese_PRC_CI_AS"/>
  <FIELD ID="15" xsi:type="CharTerm" TERMINATOR="\t" COLLATION="Chinese_PRC_CI_AS"/>
  <FIELD ID="16" xsi:type="CharTerm" TERMINATOR="\t" COLLATION="Chinese_PRC_CI_AS&q