Solved

How to insert UMLAUT into the tables

Posted on 2008-09-30
7
3,747 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MS SQL 2005 Srink database in chunks 4 58
TSQL mapping detailed records to group records 9 51
Help with SQL - TOP 10 by date and by group 13 40
Unable to save view in SSMS 21 70
When writing XML code a very difficult part is when we like to remove all the elements or attributes from the XML that have no data. I would like to share a set of recursive MSSQL stored procedures that I have made to remove those elements from …
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.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

773 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