sql server 2012 express do not understand Russian letters -
i have db working russian text when run queries shows me this. database used russians , has show russian text properly!
any ideas how fix it? in future located in russia , work russian version sql server right working on english version sql 2012 express.
here table , insert statement:
create table employee ( empid int not null identity (10, 1), strname nvarchar (25) not null, phone1 nvarchar (25) not null, phone2 nvarchar (25) primary key (empid), ); insert employee (lastname , firstname,phone1,phone2) values ('Иванов','111 111 11111','111 111 1111');
are sure data has been stored in database correctly? how know?
make sure column has proper collation, defined nvarchar
, inserts of string literals prefixed n
. example, these not same:
insert dbo.table(column) select 'foo'; insert dbo.table(column) select n'foo';
as example:
use tempdb; go create table dbo.foo ( id int primary key, bar nvarchar(32) collate sql_ukrainian_cp1251_ci_as ); insert dbo.foo select 1,'АБВГДЕЖЅzЗИІКЛ'; insert dbo.foo select 2,n'АБВГДЕЖЅzЗИІКЛ'; select id, bar dbo.foo; go drop table dbo.foo;
results:
id bar ---- -------------- 1 ????????z????? 2 АБВГДЕЖЅzЗИІКЛ
and show how affects insert statement, string missing n
prefix:
select convert(nvarchar(32), 'Иванов'), convert(nvarchar(32), n'Иванов');
results:
------ ------ ?????? Иванов
so, prefix unicode strings n'a prefix'
or lose data.
Comments
Post a Comment