Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to insert UMLAUT into the tables

Posted on 2008-09-30
7
Medium Priority
?
4,216 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: 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!

 

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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

688 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