Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

umlaut /codepage/ OEM

Status
Not open for further replies.

JRtoad

Technical User
Dec 19, 2003
15
US
I am trying to bcp ascii data into sql from a .txt file that has characters such as umlaut. running the bcp statement from cmd line using the argument "-c", the characters change from an "ä" to ',,' (double comma). other characters experience similar changes. the code_page is set to 1252 for the server.

EXAMPLE:
En skärgårdssgen, Op. 20/R 49
En sk„rg†rdss„gen, Op. 20/R 49



Are there any bcp utility arguments that can help this situation? Or any other ways around getting these types of characters to bcp correctly into the DB?

thank you..
 
Try nvarchar and see if that solves the problem. Or change the collation onthe collumn to a language which unlauts.
 
your first question "what is the datatype of the field you are importing into?" clued me to try changing the datatype of the column from varchar to nvarchar. I tried that and it did not seem to solve the issue.

On a side note, I tried using DTS to perform the data import and was able to get the data in correctly using the OEM option for the file type. (That was having the datatype of the column set as varchar) So there must be a way of setting the bcp statement in the cmd line no?

I would prefer to run this from a cmd line bcp statement rather than scripting a DTS file to be called from the cmd line. So, i am still hoping that there will be fix within the cmd line arguments...anyone?

In the meantime, I will try your other suggestion "SQLSis" to change the collation on the column.

thanks
 
If my codepage is set to 1252 and i was able to DTS data into the column with an umlaut, shouldnt that indicate that the DB be set correctly? I was going to try and change the collation on that column, but codepage 1252 should be able to accept umlauts.

So are there any ideas of what is going on here? ...Why am i able to DTS (choosing OEM file type) correctly and not from a cmd lind bcp statement.
 
thanks for the leads on this.

I was actually able to resolve this issue straight from the BOL info for "bcp utlity". I was able to set the argument "-C 437" to indicate that the file being used has international characters.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top