Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to insert UMLAUT into the tables

Posted on 2008-09-30
7
Medium Priority
?
4,327 Views
Last Modified: 2012-05-05
Hi Expert!

I need insert UMLAUTs (like ä,ü,ß) into MS SQL Database.

The INSERTs are stored in  .sql files. These files we are using for Oracle and for MS SQL.
Fragment  of the .sql File
INSERT INTO
TU_TYPE_DESC(TUTD_TUT_NAME, TUTD_LNG_NAME_TEXT, TUTD_TEXT)
VALUES ('1', 'de-DE', 'Einzelstück');

For inserting I use the BATCH files : Create_DB_Oracle.bat and Create_DB_MSSQL.bat
To correct insert UMLAUTs into Oracle DB, I use the following fragment in the BATCH
 
    SET NLS_LANG=GERMAN_GERMANY.UTF8

What should I do, that the UMLAUTs will be correct inserted and into the MSSQL database?


0
Comment
Question by:VN2008
  • 3
  • 2
  • 2
7 Comments
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 22605910
is your database column of data type varchar (or text) or Nvarchar (nText).

you need to support unicode characters so it needs to be either nvarchar or nText.  If you are using SQL 2005, you should use NVARCHAR(MAX) and varchar(max) instead of nText and Text always.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 22610830
Brandon,

What makes you think they have to be Unicode?  Just because they are not US-English does not imply they have to be Unicode.

Try this and you will see what I mean:
Declare @Temp table (Value varchar(20))
Insert @Temp Values ('ä')
Insert @Temp Values ('ü')
Insert @Temp Values ('ß')

Select *
From @Temp
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 22610836
I suspect the problem may in fact be your batch file.  Can you please post it?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:VN2008
ID: 22612198
Hi Experts!
Thanks for the replay.

In the attach you can find the picture, where the UMLAUT is incorrect.

Because of the security on Expert-Exchange I cannot attach ZIP of BATCH/SQL
So, the BATCH/SQL (zipped) are under the link
http://www.leantools-software.com/sql/sqlserver.zip


sql-umlaut.JPG
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 22620368
I am afraid I have no idea.  Feel free to follow Brandon's suggestion, it could well be I have no idea what I am talking about :)
0
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 22620401
What are you using to execute the .SQL commands?

sqlcmd? osql? vbs with ado?

I bet if you run a sql profiler trace when the insert runs, it is being passed in incorrectly because acperkins is correct about it not needing to be unicode.

That was just my first guess.  I don't really encouter these characters often (if at all).
0
 

Accepted Solution

by:
VN2008 earned 0 total points
ID: 22622147
Hi Experts!
 Thank you very much for the tips.
 I was surprised, that for this common problem I cannot find a solution in the Web.
 The idea is, that my problem is in something special. And it is so!

 I have said before, that my .sql file are in UTF-8 format,
 and MS SQL (or sqlcmd.exe) does not recognize the Umlauts.

  But :
  ----- the .SQL files we create automatically using our Script generator.
         And the UMLAUTs from such files are not recognized

  ----- if I create the same .SQL file per hand, then the UMLAUTs are inserted correct!

 If I open the both files in Notepad++, then in right-bottom corner I see a different UTF-8
 See Pictures.

 So the problem is, that by generating of .sql we not always use the correct  line terminator (LF CR)

sql-umlaut-2.JPG
sql-umlaut-3.JPG
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question