gpt4 book ai didi

sql-server - 为什么我可以将乌克兰语字符串存储在 varchar 列中?

转载 作者:行者123 更新时间:2023-12-02 02:47:05 25 4
gpt4 key购买 nike

我有点惊讶,因为我能够在 varchar 列中存储乌克兰语字符串。

我的 table 是:

create table delete_collation
(
text1 varchar(100) collate SQL_Ukrainian_CP1251_CI_AS
)

并且使用此查询我可以插入:

insert into delete_collation
values(N'використовується для вирішення квитки')

但是当我删除 'N' 时,它在 select 语句中显示 ??????

可以吗,还是我在通过整理理解 unicode 和非 unicode 时遗漏了一些东西?

最佳答案

来自MSDN :

Prefix Unicode character string constants with the letter N. Without the N prefix, the string is converted to the default code page of the database. This default code page may not recognize certain characters.

更新:
请查看类似问题::
What is the meaning of the prefix N in T-SQL statements?
Cyrillic symbols in SQL code are not correctly after insert
sql server 2012 express do not understand Russian letters

关于sql-server - 为什么我可以将乌克兰语字符串存储在 varchar 列中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32473172/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com