conversion between types DT_UI1 and DT_I4 RRS feed

  • Question

  • I have an xml file e.g
    <?xml version="1.0" encoding="utf-8" ?>
    <book id="1">
    <book id="2">

    xml schema:
    <?xml version="1.0"?>
    <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="">
      <xs:element name="books">
            <xs:element minOccurs="0" maxOccurs="unbounded" name="book">
                  <xs:element minOccurs="0" name="name" type="xs:string" />
                  <xs:element minOccurs="0" name="title" type="xs:string" />
                <xs:attribute name="id" type="xs:unsignedByte" use="optional" />

    I want to move the data to a sql table.But i keep getting error conversion between types DT_UI1 and  DT_I4
    on the id column.
    My books table has ID with the datatype int and the rest as an nvarchar.
    Which i reckon thats why but how can i convert the my ID colum in the xml to an int.
    Thanks in advance
    Tuesday, June 9, 2009 6:58 AM

All replies