Re: XSD and BulkInsert
- From: Tatopitta <Tatopitta@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 11 Jan 2008 05:06:05 -0800
Hi Rùben,
I have already tried the WhiteSpace command: it seems it is not recognized
by BulkInsert. I'm currently using the XSD, and not the XDR.
"Rubén Garrigós" wrote:
Try to change the definition of plate2 to:.
<xs:element name="PLATE2" minOccurs="0" sql:field="StrTrailerPlate">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:whiteSpace value=“preserve”/>
<xs:maxLength value="20"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
You are using XDR reprecated attributes (sql:field). If you want to upgrade
ugrade to a XSD schema
(http://msdn2.microsoft.com/en-us/library/ms171874.aspx) can help you.
You can try not allowing nulls into the table and see if it makes any
difference. Try adding a default value of ' ' to the column too.
--
Rubén Garrigós
Solid Quality Mentors
"Tatopitta" <Tatopitta@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:F3182466-DECE-4040-832B-23E951E5F336@xxxxxxxxxxxxxxxx
This is an example of the message:
<Message>
<Vehicle>
<PLATE1>33EDJ78</PLATE1>
<PLATE2> </PLATE2>
...
Example of XSD:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
<xs:element name="Vehicle" sql:relation="TmpVehicle">
<xs:complexType>
<xs:sequence>
<xs:element name="PLATE1" sql:field="StrEnginePlate">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="20"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="PLATE2" minOccurs="0" sql:field="StrTrailerPlate">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="20"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
...
Thanks a lot!!!
"Rubén Garrigós" wrote:
Hmm maybe the problem is related with the xsi:nil property or the schema
used. Can you send an example of the XML file?
"Tatopitta" <Tatopitta@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D940BCC0-D262-4CFD-BF20-4E170F015F06@xxxxxxxxxxxxxxxx
I hope this is not out of topic. If yes, sorry and tell me the correct
group.
We're using BulkInsert to load xml files in a SQLExpress DB.
In one XML field we may have whitespace" " but when the file is loaded,
in
the DB we have null value for this field: we want to have emptyspace
also
in
the DB. Do you know if there are settings or parameters to solve this
problem?
Thanks a lot!
--
Rubén Garrigós
Solid Quality Mentors
- Follow-Ups:
- Re: XSD and BulkInsert
- From: Rubén Garrigós
- Re: XSD and BulkInsert
- References:
- Re: XSD and BulkInsert
- From: Tatopitta
- Re: XSD and BulkInsert
- From: Rubén Garrigós
- Re: XSD and BulkInsert
- Prev by Date: Re: XSD and BulkInsert
- Next by Date: "for xml" via rpc - why do I receive binary data?
- Previous by thread: Re: XSD and BulkInsert
- Next by thread: Re: XSD and BulkInsert
- Index(es):
Relevant Pages
|
Loading