OSQL and special characters

  • I'm trying to create a database and populate it with data via an NT batch script that makes OSQL calls to execute TSQL scripts. One of the tables contains text strings in English and German. Some of the special characters in German (such as an umlaut) are not being correctly inserted into the table. I'm suspecting that the issue has to do with OSQL, because if I execute the script manually in Query Analyzer, the data is loaded properly. The datatype of the text field is defined as an nvarchar(x).

    I don't see an OSQL switch that might have anything to do with this, unless it's staring me in the face and I'm just missing it. If anyone has some insight into this issue I would greatly appreciate any information that you might have to offer.

    Chris

  • osql uses ODBC, perhaps you have conflicting conversion settings there?

    Have you tried loading with bcp? bcp offers some switches regarding collation and format.

    /Kenneth

  • Try adding "Auto Translate=False" to your connection string.

  • Hi,

    save your SQL script files in UNICODE format.

    Follow below mentioned steps:

    + Open your script from query analyzer window

    + Save our file in UNICODE (save as, UNICODE)

    Rambabu

     

     

  • I decided to go with Rambabu's suggestion to save the script in UNICODE, as it was the easiest to implement. That worked great!

    Thanks, everyone, for your replies! All were good solutions, and I learned something more about OSQL.

    Chris

  • Great!

     

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply