Sunday, January 1, 2017

Converting SQL text columns from a single byte character codes to UTF8

use my_database;
-- preserve your old data in blob type
alter table my_tabe change my_column my_column blob;
-- set your default encoding to utf8
alter table my_table convert to character set utf8;
-- tell sql server your old code page ( i.e.: cp1256 )
alter table my_table change my_column my_column text charset {{code page}};

No comments:

Post a Comment