Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2008
»
SQL Server 2008 - General
»
Problems with unicode
Problems with unicode
Rate Topic
Display Mode
Topic Options
Author
Message
RedDoorSQL
RedDoorSQL
Posted Wednesday, October 31, 2012 5:07 AM
SSC Rookie
Group: General Forum Members
Last Login: Today @ 4:09 AM
Points: 44,
Visits: 132
I'm having a problem inserting a value into a varchar datatype field,
the value I'm trying to update a value in a column top 'vič' but when its updated it removes the accent above the c however in the same column there is a value š and the s retains its accent.
Can anyone explain why, I know I can convert the column to nvarchar and this will sort the problem but i'm confused why one is accepted the other isn't.
Also if I convert a Varchar datatype column to nvarchar would that alter any of the text at all.
Post #1379243
anthony.green
anthony.green
Posted Wednesday, October 31, 2012 5:21 AM
SSCertifiable
Group: General Forum Members
Last Login: Friday, April 12, 2013 3:51 AM
Points: 5,075,
Visits: 4,831
All down to the code page and ASCII conversion.
select ASCII('š')
select ASCII('č')
The first returns ASCII code 154 which is the correct code for that character, but the latter returns ASCII code 99 which is for lowercase C.
I am guessing that your collation is set to a latin collation and therefore it is converting č to c as č is not a latin ASCII character.
Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1
&
Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger
Post #1379250
RedDoorSQL
RedDoorSQL
Posted Wednesday, October 31, 2012 5:33 AM
SSC Rookie
Group: General Forum Members
Last Login: Today @ 4:09 AM
Points: 44,
Visits: 132
Correct its just taking the database collation of Latin_General_CI_AS,
is there anything which I can do so this value could be updated or would it be a case of changing the collation at a column level or altering it to nvarchar.
Thanks for the help
Post #1379253
anthony.green
anthony.green
Posted Wednesday, October 31, 2012 5:57 AM
SSCertifiable
Group: General Forum Members
Last Login: Friday, April 12, 2013 3:51 AM
Points: 5,075,
Visits: 4,831
The only way would be to change the column to NVARCHAR, collation changes may work but then you introduce a whole host of potential problems as certain characters will change making other updates fail.
Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1
&
Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger
Post #1379265
RedDoorSQL
RedDoorSQL
Posted Wednesday, October 31, 2012 6:02 AM
SSC Rookie
Group: General Forum Members
Last Login: Today @ 4:09 AM
Points: 44,
Visits: 132
Thanks thats what i'm thinking, never been the most knowledgeable on Collations so this could prove quite catastrophic if I start messing around when really its not required
Post #1379267
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.