Solved

cannot load field from xml source

Posted on 2012-04-13
1
297 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Help with SQL joins 9 58
how many extra RAM for SQL server is needed 23 49
Delete from table 6 49
How come this XML node is not read? 3 53
If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

739 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