简体   繁体   English

MSSQL相同的排序规则列显示不同的数据

[英]MSSQL same collation columns show different data

I have two databases. 我有两个数据库。 I get data from first database and put it to second. 我从第一个数据库获取数据,然后将其放入第二个数据库。
So the main problem that I have a same columns 所以我有相同的专栏的主要问题

(collation - Latin1_General_CI_AS, data type - nvarchar, length - 90) . (排序规则-Latin1_General_CI_AS,数据类型-nvarchar,长度-90)。

but first database's column displays a specific symbols like "ā", "ī", "ē", etc. and the second databases's column turn it to "a", "i", "e". 但是第一个数据库的列显示特定的符号,例如“ā”,“ī”,“ē”等,第二个数据库的列将其变为“ a”,“ i”,“ e”。

So can you please tell me a reason why this this happens? 那么,能否请您告诉我发生这种情况的原因?

You need to be sure that you prefix Unicode string literals with an N prefix. 您需要确保为Unicode字符串文字加上N前缀。 Like this. 像这样。

QUERY 1: (OLD Query's String) 查询1 :(旧查询的字符串)

SELECT 'If the alternative 
 hypothesis is as  Ha:µ ≠µ0';

OUTPUT: 输出:

If the alternative hypothesis is as Ha:µ ?µ0

In the above query is missing 在上面的查询中丢失

QUERY 2: (NEW Query's String) 查询2:(NEW查询的字符串)

SELECT 'If the alternative 
 hypothesis is as  Ha:' + N'µ ≠µ0';

OUTPUT: 输出:

If the alternative hypothesis is as Ha:µ ≠µ0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM