Solved

How to insert UMLAUT into the tables

Posted on 2008-09-30
7
3,635 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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

This article will describe one method to parse a delimited string into a table of data.   Why would I do that you ask?  Let's say that you need to pass multiple parameters into a stored procedure to search for.  For our sake, we'll say that we wa…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now