dbTalk Databases Forums  

Importing a Unicode (UTF16) flat-file into SqlServer 2000 using DTS

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


Discuss Importing a Unicode (UTF16) flat-file into SqlServer 2000 using DTS in the microsoft.public.sqlserver.dts forum.



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

Default Importing a Unicode (UTF16) flat-file into SqlServer 2000 using DTS - 04-06-2005 , 02:07 PM






I don't know if this has been documented anywhere, but it's news to me.
We were having problems attempting to import a Unicode, tab-delimited,
flat-file into SqlServer 2000 using a DTS package.

One of the things we found is that DTS will only import a Unicode
(UTF-16) file if the field-data is surrounded by a text-qualifier. It
doesn't care what you use as a field-separator; it just needs that
text-qualifier. Use CSV and avoid headaches.

The next, more important thing: the file MUST be in Little-endian
(0xFFFE). DTS cannot handle Big-endian (0xFEFF) in SqlServer 2000. We
tried 2 files, where the only difference was that one was Little-endian
and the other was Big-endian, the Little-endian version imported while
the Big-endian version failed; yes, they both had the correct
byte-order-marker (BOM). (And VS.Net 2003 displayed both files correctly.)

Granger
PS: If your double-quote character looks like this in hex "0x0022",
that's Big-endian; you want "0x2200".

PPS: Does anyone know if DTS uses the Microsoft.Jet.OLEDB.4.0 provider
underneath when parsing text files? That would explain a problem I had
on an earlier experiment I tried.

Reply With Quote
  #2  
Old   
Ilya Margolin
 
Posts: n/a

Default Re: Importing a Unicode (UTF16) flat-file into SqlServer 2000 using DTS - 04-07-2005 , 07:21 AM






Granger,

Have you considered old fashionate BCP?

Ilya

"Granger Godbold" <granger.godbold (AT) FILLER (DOT) prometric.com> wrote

Quote:
I don't know if this has been documented anywhere, but it's news to me.
We were having problems attempting to import a Unicode, tab-delimited,
flat-file into SqlServer 2000 using a DTS package.

One of the things we found is that DTS will only import a Unicode
(UTF-16) file if the field-data is surrounded by a text-qualifier. It
doesn't care what you use as a field-separator; it just needs that
text-qualifier. Use CSV and avoid headaches.

The next, more important thing: the file MUST be in Little-endian
(0xFFFE). DTS cannot handle Big-endian (0xFEFF) in SqlServer 2000. We
tried 2 files, where the only difference was that one was Little-endian
and the other was Big-endian, the Little-endian version imported while
the Big-endian version failed; yes, they both had the correct
byte-order-marker (BOM). (And VS.Net 2003 displayed both files correctly.)

Granger
PS: If your double-quote character looks like this in hex "0x0022",
that's Big-endian; you want "0x2200".

PPS: Does anyone know if DTS uses the Microsoft.Jet.OLEDB.4.0 provider
underneath when parsing text files? That would explain a problem I had
on an earlier experiment I tried.



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.