tjlahr
tjlahr

Reputation:

Why are my accented characters breaking in SQL Server 2005?

When I update my database with this command:

UPDATE myTable SET Name = 'Hermann Dönnhoff' WHERE ID = 123;

SQL Server actually puts 'Hermann Do¨nnhoff' in the field instead. Instead of faithfully inserting the o-umlaut (char(246)), I'm getting two characters ( char(111) + char (168) ). This happens for all characters that have accent marks, not just umlauts. Has anybody seen this?

Thank you.

Upvotes: 2

Views: 1440

Answers (1)

John Gietzen
John Gietzen

Reputation: 49565

You need to use the nchar, nvarchar, or ntext datatypes for Unicode data.

The issue is that your code page does not directly support those characters.

Read up on collations for more information:

http://msdn.microsoft.com/en-us/library/aa214408%28SQL.80%29.aspx

http://msdn.microsoft.com/en-us/library/aa174903%28SQL.80%29.aspx

Upvotes: 6

Related Questions