Mombu the Microsoft Forum sponsored links

Go Back   Mombu the Microsoft Forum > Microsoft > xsd schema not properly transalated into table
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 2nd June 18:13
davidbr93
External User
 
Posts: 1
Default xsd schema not properly transalated into table



I'm new to xsd files and am experience a problem in usage.

I have an xsd and xml file I'm trying to get into sql server. I'm
using sqlserver 2000 bulkload through a dts package. Within the
activex script I specify to generate the schema based on the xsd. The
package works fine but when I look at the table I find that all string
fields are defined as nvarchar(1000). Here is a snippit of the xsd
file. The CDT_FIELD_NO & CDT_FIELD_VALUE appear as nvarchar(1000)
fields. Is the XSD I've been given the problem?


<?xml version="1.0" standalone="yes"?>
<xs:schema id="NewDataSet" xmlns=""
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="CDT_FIELD_TEST">
<xs:complexType>
<xs:sequence>
<xs:element name="Id" msdata:ReadOnly="true"
type="xs:int" minOccurs="0" />
<xs:element name="ParentId" msdata:ReadOnly="true"
msdata:AutoIncrementSeed="1" type="xs:int" minOccurs="0" />
<xs:element name="CDT_FIELD_NO" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="10" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="CDT_FIELD_VALUE" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="18" />
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
  Reply With Quote


  sponsored links


2 2nd June 18:13
davidbr93
External User
 
Posts: 1
Default xsd schema not properly transalated into table



I'm new to xsd files and am experience a problem in usage.

I have an xsd and xml file I'm trying to get into sql server. I'm
using sqlserver 2000 bulkload through a dts package. Within the
activex script I specify to generate the schema based on the xsd. The
package works fine but when I look at the table I find that all string
fields are defined as nvarchar(1000). Here is a snippit of the xsd
file. The CDT_FIELD_NO & CDT_FIELD_VALUE appear as nvarchar(1000)
fields. Is the XSD I've been given the problem?


<?xml version="1.0" standalone="yes"?>
<xs:schema id="NewDataSet" xmlns=""
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="CDT_FIELD_TEST">
<xs:complexType>
<xs:sequence>
<xs:element name="Id" msdata:ReadOnly="true"
type="xs:int" minOccurs="0" />
<xs:element name="ParentId" msdata:ReadOnly="true"
msdata:AutoIncrementSeed="1" type="xs:int" minOccurs="0" />
<xs:element name="CDT_FIELD_NO" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="10" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="CDT_FIELD_VALUE" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="18" />
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
  Reply With Quote


  sponsored links


3 2nd June 18:14
yitzhak
External User
 
Posts: 1
Default xsd schema not properly transalated into table


This is a default behavior of the XML Bulk Load.

You should change your XSD schema ********ely specifying
SQL data types mapping, like:
<xsd:element name="YourElementName" sql:datatype="varchar
(10)">

For details, see "Data Type Coercions and the sql:datatype
Annotation" in the SQLXML help.

usage.


server. I'm

Within the

the xsd. The

that all string

of the xsd

nvarchar(1000)

msdata:ReadOnly="true"

minOccurs="0" />

minOccurs="0">

minOccurs="0">
  Reply With Quote
4 2nd June 18:15
yitzhak
External User
 
Posts: 1
Default xsd schema not properly transalated into table


This is a default behavior of the XML Bulk Load.

You should change your XSD schema ********ely specifying
SQL data types mapping, like:
<xsd:element name="YourElementName" sql:datatype="varchar
(10)">

For details, see "Data Type Coercions and the sql:datatype
Annotation" in the SQLXML help.

usage.


server. I'm

Within the

the xsd. The

that all string

of the xsd

nvarchar(1000)

msdata:ReadOnly="true"

minOccurs="0" />

minOccurs="0">

minOccurs="0">
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666