Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
SQL Server数据库存储'ć';as';c';_Sql_Sql Server_Tsql - Fatal编程技术网

SQL Server数据库存储'ć';as';c';

SQL Server数据库存储'ć';as';c';,sql,sql-server,tsql,Sql,Sql Server,Tsql,我想在我的sql server数据库中存储巴尔干姓氏,但当我尝试使用以下sql更新记录时: update User_Data set name = 'Kramarić' where User_PKID= 3047 但是,当我使用以下命令查询数据库时: select name from User_Data where User_PKID = 3047 它返回: Kramaric 你知道我怎样才能把它保存成原样吗。我需要它,就像我在服务器代码上与来自网站的数据进行字符串比较一样,如果'ć'不相

我想在我的sql server数据库中存储巴尔干姓氏,但当我尝试使用以下sql更新记录时:

update User_Data
set name = 'Kramarić'
where User_PKID= 3047
但是,当我使用以下命令查询数据库时:

select name from User_Data where User_PKID = 3047
它返回:

Kramaric

你知道我怎样才能把它保存成原样吗。我需要它,就像我在服务器代码上与来自网站的数据进行字符串比较一样,如果'ć'不相同,它将失败。

您的列
名称
是什么数据类型?处理Unicode字符应该是
NVARCHAR

您还必须使用
N'…'
前缀来指定Unicode字符串:

UPDATE dbo.User_Data
SET name = N'Kramarić'
WHERE User_PKID= 3047

您的列的数据类型是什么?处理Unicode字符应该是
NVARCHAR

您还必须使用
N'…'
前缀来指定Unicode字符串:

UPDATE dbo.User_Data
SET name = N'Kramarić'
WHERE User_PKID= 3047


你试过使用nvarahar吗?此链接可能会帮助您:您是否尝试过使用nvarahar?此链接可能会帮助您: