dbTalk Databases Forums  

Cannot import xml into varchar fields using SSIS

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Cannot import xml into varchar fields using SSIS in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
forrestsjs
 
Posts: n/a

Default Cannot import xml into varchar fields using SSIS - 07-07-2006 , 04:33 PM






I want to import xml into varchar fields using SSIS, but the package designer
does not allow me...I get an error...

cannot convert between unicode and non-unicode string data

Changing varchar to nvarchar in the table fixes that problem, but of course
takes up more db space.

Is there a trick to getting around this or a way to describe the xml as
non-unicode so that SSIS does not see the source xml as unicode strings...or
will it always assume all xml is unicode?

I have the SSIS 2005 Wrox book but it does not elaborate much on this and
only has one example (importing into nvarchar fields which works but is not
great for large data warehouses). Any other good resources for this info?

Thanks,
Forrest


Reply With Quote
  #2  
Old   
Hasan Quadri
 
Posts: n/a

Default RE: Cannot import xml into varchar fields using SSIS - 07-12-2006 , 05:30 PM






Forrest,

You need to put the XML Source output into a Data Conversion transformation
and convert all the Unicode string data to ANSI (i.e., DT_WSTR->DT_STR,
DT_NTEXT->DT_TEXT). I'm not entirely sure why XML Source automatically uses
Unicode, even if you don't specify UTF-8 as an encoding, but that's the way
it is apparently.

Hasan

"forrestsjs" wrote:

Quote:
I want to import xml into varchar fields using SSIS, but the package designer
does not allow me...I get an error...

cannot convert between unicode and non-unicode string data

Changing varchar to nvarchar in the table fixes that problem, but of course
takes up more db space.

Is there a trick to getting around this or a way to describe the xml as
non-unicode so that SSIS does not see the source xml as unicode strings...or
will it always assume all xml is unicode?

I have the SSIS 2005 Wrox book but it does not elaborate much on this and
only has one example (importing into nvarchar fields which works but is not
great for large data warehouses). Any other good resources for this info?

Thanks,
Forrest


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.