Showing posts with label tags. Show all posts
Showing posts with label tags. Show all posts

Friday, February 10, 2012

Bulkload XML Code

I have several XML file's I need bulkload into SQL 2005.
I have all my code done, but now I ran into another issue.
One of the data tags <pdata> actually contains XML tags. When I try to load
the data I get a data mapping error: Data mapping to column 'pdata' was
already found in the data. Make sure that no two schema definitions map to
the same column.
Is there any way to allow XML tags to bulkload?
I'm using a string data type.
Thanks
Charles WIf you send me the schema and the data I can take a look.
Best regards,
Monica Frintu
"Charles W" wrote:

> I have several XML file's I need bulkload into SQL 2005.
> I have all my code done, but now I ran into another issue.
> One of the data tags <pdata> actually contains XML tags. When I try to loa
d
> the data I get a data mapping error: Data mapping to column 'pdata' was
> already found in the data. Make sure that no two schema definitions map to
> the same column.
> Is there any way to allow XML tags to bulkload?
> I'm using a string data type.
>
> Thanks
> Charles W
>
>

Bulkload with default values

Hello there,
I am trying to import an xml document that have some tags as <tagname/> (so no data). So, when I did the bulk import, I am getting an error message saying the no data provided for <tagname/> and it can't be null. The table I am importing into has a defa
ult value set to blank if no value is presented.
I am trying the following:
... <xsd:element name="ship_to_add_2" default="" sql:field="ship_to_add_2" type="xsd:string"/> ...
The default="" does not do anything? What is going on?
I have to check if default works with simple type elements. If possible, can
you try making the "tagname" an attribute instead of an element and specify
default on it
thanks
Chandra
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Pardeep" <ppuar@.acdsystems.com> wrote in message
news:0F490ED0-AFC0-4C4C-92DB-560E3DB8A8A7@.microsoft.com...
> Hello there,
> I am trying to import an xml document that have some tags as <tagname/>
(so no data). So, when I did the bulk import, I am getting an error message
saying the no data provided for <tagname/> and it can't be null. The table
I am importing into has a default value set to blank if no value is
presented.
> I am trying the following:
> ... <xsd:element name="ship_to_add_2" default="" sql:field="ship_to_add_2"
type="xsd:string"/> ...
> The default="" does not do anything? What is going on?
|||Yes, I can do that and it does work that way. Is it that elements are
not supported?
Thanks
Pardeep
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!
|||default on simple type elements is a bug then.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Pardeep Puar" <ppuar@.acdsystems.com> wrote in message
news:O1DnwFmJEHA.3104@.TK2MSFTNGP10.phx.gbl...
> Yes, I can do that and it does work that way. Is it that elements are
> not supported?
> Thanks
> Pardeep
> *** Sent via Developersdex http://www.codecomments.com ***
> Don't just participate in USENET...get rewarded for it!
|||Hi Pardeep,
I tried this and it seems to work for me. Can you post your schema so that I
can investigate what is the issue?
thanks
Chandra
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Chandra Kalyanaraman [MSFT]" <chandrak@.online.microsoft.com> wrote in
message news:%23gxlgqAKEHA.2704@.TK2MSFTNGP10.phx.gbl...
> default on simple type elements is a bug then.
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> "Pardeep Puar" <ppuar@.acdsystems.com> wrote in message
> news:O1DnwFmJEHA.3104@.TK2MSFTNGP10.phx.gbl...
>
|||Can you please contact me via email and I can sent you my contact
information and we can then chat over the phone about this issue.
ppuar@.acdsystems.com
Thanks
Pardeep
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!