Convert all data in SQL Server to unicode -
my database table string columns nvarchar.
but when insert data using application, forgot add n' prefix. display not utf-8 on web. causes lot of problems.
how use t-sql command replace existing tables , string columns type , data utf-8?
first, please note sql server doesn't support utf-8, it supports utf-16. it's possible still have encoding problem in application code (you didn't show sample data or code, it's hard what's going on).
having said that, can't update data change unicode:
declare @t table (c nchar(1)) insert @t select '말' insert @t select n'말' select c, ascii(c), unicode(c) @t update @t set c = cast(c nchar(1)) select c, ascii(c), unicode(c) @t as can see, character 말 stored ascii 63 if don't use n prefix, , if convert unicode explicitly, sql server has no way magically know meant unicode code point 47568. thing can go , re-insert data correctly.
Comments
Post a Comment