I have some text files saved using a UTF-8 encoding. The "BULK INSERT"
statment in Sql Server 2000 is failing with a column length error. Saving
the file as ASCII removes the problem. However, I would like to import files
in UTF-8 format. I understand that the BCP tool, when used from the command
line, can take an "-F UTF8" argument, which allows it to work. Can this be
done from the SQL> prompt with the BULK INSERT statement?
Cheers,
Tobin"Tobes (Breath)" <tobin_dont_spam_me@.breathemail.net> wrote in message
news:bpi91v$1osvna$1@.ID-131901.news.uni-berlin.de...
> Hi there,
> I have some text files saved using a UTF-8 encoding. The "BULK INSERT"
> statment in Sql Server 2000 is failing with a column length error. Saving
> the file as ASCII removes the problem. However, I would like to import
files
> in UTF-8 format. I understand that the BCP tool, when used from the
command
> line, can take an "-F UTF8" argument, which allows it to work. Can this be
> done from the SQL> prompt with the BULK INSERT statement?
> Cheers,
> Tobin
I believe that the -F argument is for the Sybase version of BCP. The closest
equivalent in MSSQL is probably -w, but it may not be functionally
equivalent. Using BULK INSERT, that would be "DATAFILETYPE = 'widechar'".
Simon|||"Simon Hayes" <sql@.hayes.ch> wrote in message
news:3fbd17b2$1_2@.news.bluewin.ch...
> I believe that the -F argument is for the Sybase version of BCP. The
closest
> equivalent in MSSQL is probably -w, but it may not be functionally
> equivalent. Using BULK INSERT, that would be "DATAFILETYPE = 'widechar'".
Thanks for the response, Simon. Ah, I see, I must have found a Sybase
example for the -F argument! I actually discovered the 'widechar' thing in
the docs, but for some reason it was still falling over on the last column
of the first row. I tried the other options such as 'RAW' etc but with no
luck!
Currently I'm asking the developer to output the file as ASCII or ANSI, so
that should be solved (although it would be nice if the BULK INSERT
accommodated such variations). However, the files are gonna be UNIX files,
so my next trick is to have BCP understand how to read these!
Tobin
No comments:
Post a Comment