Solved

How to insert UMLAUT into the tables

Posted on 2008-09-30
7
4,067 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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 

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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

624 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