Solved

cannot load field from xml source

Posted on 2012-04-13
1
290 Views
Last Modified: 2012-04-17
Hi I'm loading data from an xml source and it does not load the field lowvolume, it defualts it to a null.  It should load a 1 into the bit field I have in the sql server 2005 tbl, but loads null.  the  <CPOAdjustment>1</CPOAdjustment> field below <LowVolume>1</LowVolume> works correctly.  I'm using the ole db destionation task to load into the db.
 
here is my xml, the xsd is also below.  

<Vehicle>
  <VehicleId>260872</VehicleId>
  <TrimId>275498</TrimId>
  <ManufacturerAssignedModelCode />
  <SubTrim />
  <DisplayName>4.2 Quattro Coupe 2D</DisplayName>
  <VehicleTypeId>1</VehicleTypeId>
  <VehicleTypeDisplayName>UsedCar</VehicleTypeDisplayName>
  <SortOrder>1</SortOrder>
  <DisplayNameAdditionalData />
  <KBBSortOrder>0</KBBSortOrder>
  <AvailabilityStatus />
  <AvailabilityStatusEndDate>1800-01-01 00:00:00</AvailabilityStatusEndDate>
  <MarketName />
  <RelatedVehicleId>0</RelatedVehicleId>
  <AvailabilityStatusStartDate>1800-01-01 00:00:00</AvailabilityStatusStartDate>
  <LowVolume>1</LowVolume>
  <CPOAdjustment>1</CPOAdjustment>
  <MileageGroupId>12</MileageGroupId>
  <BlueBookName>4.2 Coupe 2D</BlueBookName>
  <ShortName>4.2 Quattro Coupe 2D</ShortName>
 </Vehicle>
 

<?xml version="1.0" encoding="utf-8"?>
 <xs:schema id="Vehicle" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="Vehicle">
   <xs:complexType>
    <xs:sequence>
     <xs:element name="VehicleId" type="xs:int" nillable="false" />
     <xs:element name="TrimId" type="xs:int" nillable="false" />
     <xs:element name="ManufacturerAssignedModelCode" type="ManufacturerModelCodeType" nillable="false" />
     <xs:element name="SubTrim" type="xs:string" nillable="false" />
     <xs:element name="DisplayName" type="xs:string" nillable="false" />
     <xs:element name="VehicleTypeId" type="xs:int" nillable="false" />
     <xs:element name="VehicleTypeDisplayName" type="xs:string" nillable="false" />
     <xs:element name="SortOrder" type="xs:int" nillable="false" />
     <xs:element name="DisplayNameAdditionalData" type="xs:string" nillable="false" />
     <xs:element name="KBBSortOrder" type="xs:int" nillable="false" />
     <xs:element name="AvailabilityStatus" type="xs:string" nillable="false" />
     <xs:element name="AvailabilityStatusEndDate" type="xs:string" nillable="false" />
     <xs:element name="MarketName" type="xs:string" nillable="false" />
     <xs:element name="RelatedVehicleId" type="xs:int" nillable="false" />
     <xs:element name="AvailabilityStatusStartDate" type="xs:string" nillable="false" />
     <xs:element name="LowVolumne" type="xs:boolean" nillable="false" />
     <xs:element name="CPOAdjustment" type="xs:boolean" nillable="false" />
     <xs:element name="MileageGroupId" type="xs:int" nillable="false" />    
     <xs:element name="BlueBookName" type="xs:string" nillable="false" />
     <xs:element name="ShortName" type="xs:string" nillable="false" />    
    </xs:sequence>
   </xs:complexType>
  </xs:element>
  <xs:simpleType name="ManufacturerModelCodeType">
   <xs:restriction base="xs:string">
    <xs:maxLength value="30" />
   </xs:restriction>
  </xs:simpleType>
  <xs:element name="VehicleRoot">
   <xs:complexType>
    <xs:sequence>
     <xs:element ref="Vehicle" maxOccurs="unbounded" minOccurs="1" />
    </xs:sequence>
   </xs:complexType>
  </xs:element>
 </xs:schema>
0
Comment
Question by:elucero
1 Comment
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 500 total points
ID: 37845426
You have a typo.  This:
<xs:element name="LowVolumne" type="xs:boolean" nillable="false" />
Should be:
<xs:element name="LowVolume" type="xs:boolean" nillable="false" />
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question