none
SQLState=S1000, NativeError=0

    Question

  • I am trying to use the BCP command to execute the following statement, but I keep getting the following error:

    Starting copy...
    SQLState = S1000, NativeError = 0
    Error = [Microsoft][SQL Server Native Client 10.0]Unexpected EOF encountered in
    BCP data-file

    0 rows copied.
    Network packet size (bytes): 4096
    Clock Time (ms.) Total     : 1

    My BCP command:

    bcp Development.dbo.wbl_Load in zSkywardEWCodes.xml -m50 -e ErrorLog -b100 -S just5clicks.com -U###### -P######

    and the "#"s represent my username and password

     

    This is a very small XML file and here are it's contents:

    <xml xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'
     xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'
     xmlns:rs='urn:schemas-microsoft-com:rowset'
     xmlns:z='#RowsetSchema'>
    <s:Schema id='RowsetSchema'>
     <s:ElementType name='row' content='eltOnly'>
      <s:AttributeType name='c0' rs:name='WITHDRAWAL-CODE' rs:number='1'>
       <s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='6' rs:maybenull='false'/>
      </s:AttributeType>
      <s:AttributeType name='c1' rs:name='WITHDRAWAL-SDESC' rs:number='2' rs:nullable='true'>
       <s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='30'/>
      </s:AttributeType>
      <s:extends type='rs:rowbase'/>
     </s:ElementType>
    </s:Schema>
    <rs:data>
     <z:row c0='00' c1='00 Withdrawn pr'/>
     <z:row c0='01' c1='01 Change grade'/>
     <z:row c0='02' c1='02 Trans-pubSam'/>
     <z:row c0='03' c1='03 Trans-nonpub'/>
     <z:row c0='04' c1='04 Moved out of'/>
     <z:row c0='05' c1='05 Moved out of'/>
     <z:row c0='06' c1='06 Left-age wit'/>
     <z:row c0='07' c1='07 Left-age wit'/>
     <z:row c0='08' c1='08 Grad'/>
     <z:row c0='09' c1='09 Grad-met IEP'/>
     <z:row c0='11' c1='11 Died'/>
     <z:row c0='12' c1='12 Excused-disa'/>
     <z:row c0='13' c1='13 Commit to co'/>
     <z:row c0='14' c1='14 Withdrawn 15'/>
     <z:row c0='15' c1='Lft Marriage'/>
     <z:row c0='16' c1='16 Expelled'/>
     <z:row c0='17' c1='Left sch Pregna'/>
     <z:row c0='18' c1='18 Withdrawn no'/>
     <z:row c0='20' c1='20 Transfer did'/>
     <z:row c0='21' c1='21 EC Withdrawa'/>
     <z:row c0='22' c1='22 Entered care'/>
     <z:row c0='23' c1='23 Kindergarten'/>
     <z:row c0='24' c1='24 Homebound'/>
     <z:row c0='25' c1='25 EC eval only'/>
     <z:row c0='26' c1='26 EC withdrawa'/>
     <z:row c0='27' c1='27 EC transitio'/>
     <z:row c0='28' c1='Not eligile 3yr'/>
     <z:row c0='29' c1='Not elig for 3y'/>
     <z:row c0='30' c1='3yr elig not de'/>
     <z:row c0='31' c1='31 Left -social'/>
     <z:row c0='32' c1='32 Left - finan'/>
     <z:row c0='33' c1='33 Left - famil'/>
     <z:row c0='34' c1='34 Left-Unknown'/>
     <z:row c0='35' c1='35 Left-Over 21'/>
     <z:row c0='36' c1='enrol post seco'/>
     <z:row c0='37' c1='37 Left- to GED'/>
     <z:row c0='40' c1='40 EOY Enrolled'/>
     <z:row c0='41' c1='41 Dropped/ReEn'/>
     <z:row c0='42' c1='42  met loc gra'/>
     <z:row c0='50' c1='50 Special ed s'/>
     <z:row c0='60' c1='No Referal'/>
     <z:row c0='61' c1='Referal to SpEd'/>
     <z:row c0='62' c1='Refer HealthCar'/>
     <z:row c0='63' c1='Refer SpEd/Heal'/>
     <z:row c0='64' c1='Refer EC Progam'/>
     <z:row c0='65' c1='Refer Parent No'/>
     <z:row c0='97' c1='Displaced NonRe'/>
     <z:row c0='99' c1='99 Enrollment S'/>
     <z:row c0='WCV' c1='DO NOT USE'/>
     <z:row c0='YE' c1='DO NOT USE'/>
    </rs:data>

     

    </xml>

    And this is my SQL table in the Development database which is currently empty:

    CREATE TABLE wbl_Load (xCol xml);
    GO

    I am not using a format file but here is what I choose from the command prompt:
    "xml"
    enter
    \n\n\n

     The strange thing is that I get a record returned with the following command:

    SELECT

     

    *

     

    FROM OPENROWSET(BULK 'D:\ftproot\LocalUser\RyanDaulton\data\zSkywardEWCodes.xml', SINGLE_BLOB

     

    ) AS mytable;

     
    Wednesday, September 01, 2010 4:05 PM