Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
raphaelrivest
Starting Member
14 Posts |
Posted - 2009-06-15 : 14:13:52
|
Hi,I'm trying to insert (with BULK INSERT) french characters (é,ê,è,ç,û...) from a csv file.But they all appear like "T".I'm working on a SQL Server 2005. The collation used is SQL_Latin1_General_CP1_CI_AS. But I tried different collations (SQL_Latin1_General_Cp1250_CS_AS, Latin1_General_CS_AS, SQL_Latin1_General_Cp1251_CS_AS). The only difference I see is the characters appear like "?" or "T".Someone has an idea?Raph. |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-06-15 : 14:21:35
|
are you using nchar,nvarchar as datatype? |
 |
|
raphaelrivest
Starting Member
14 Posts |
Posted - 2009-06-15 : 14:23:55
|
I use varchar. |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-06-15 : 14:26:45
|
try using nvarchar |
 |
|
raphaelrivest
Starting Member
14 Posts |
Posted - 2009-06-15 : 14:31:12
|
I already tried. It still gives weird characters. :( |
 |
|
Arnold Fribble
Yak-finder General
1961 Posts |
Posted - 2009-06-16 : 08:13:14
|
quote: But they all appear like "T".
When you say "all", you actually mean that the "é" -- lowercase e acute -- character gets loaded as "T", don't you?In short your BULK INSERT needs a WITH parameter so it knows what character encoding the file it in: CODEPAGE = 'ACP'Otherwise, it will interpret the file as being in "the system OEM code page", which in your case is CP 437. And in CP 437, the character encoded as 0xE9 is Greek Capital Letter Theta, which then gets down-converted when you put it in a varchar column to a captial T. |
 |
|
raphaelrivest
Starting Member
14 Posts |
Posted - 2009-06-16 : 10:10:59
|
Thank you, Arnold! With the parameter (CODEPAGE = 'ACP'), it's working perfectly!Raph. |
 |
|
ellenyue
Starting Member
1 Post |
Posted - 2010-08-05 : 16:17:53
|
Hi,I have the exactly same question. I tried CODEPAGE = 'ACP', it I only insert 1000 records, it worked perfectly. But if I insert 28,000 records, the weird charaters come out again.Someone met the same issue?ellen |
 |
|
|
|
|
|
|