1

????如果更新程序字段是用阿拉伯语编写的,则 UPDATE 给出 ,这是我的查询:

UPDATE  students 
SET first_name = 'الاسم' , last_name = 'الاسم الاخير' , 
    father_name = 'الاسم الاخير' , mother_name = '', 
    birth_date = '1/1/1990 12:00:00 AM' , education_level = '' , 
    address = '' , notes = '' 
WHERE student_id = 33

这是更新的结果:

student_id  first_name  last_name   mother_name     father_name   birth_date    
33           ?????      ?????          ??????       ???????????   1990-01-01

//答案很好,谢谢大家,另一个问题是我在我的 C# 程序中使用了这个 UPDATE 语法

command.CommandText = "UPDATE  students SET " +
        "first_name = " + "'" + first_name + "'" + " , last_name = " + "'" + last_name + "'" +
         " , father_name = " + "'" + father_name + "'" + " , mother_name = " + 
        "'" + mother_name + "'" + ", birth_date = " + "'" + birth_date + "'" +
        " , education_level = " + "'" + education_level + "'"  +
        " , address = " + "'" + address + "'" + " , notes = " + "'" + notes + "'" +
        " WHERE student_id = " + id ;

//如何使用字符N

4

2 回答 2

8

您忘记了N字符串文字之前的前缀,这是必需的,因此它们将被视为nvarchar而不是varchar

SET first_name = N'الاسم'等等

否则,文本将被强制转换为默认排序规则的代码页可以处理的任何字符。

于 2012-06-18T10:50:26.280 回答
0

使用此排序规则 Arabic_CI_AS 创建数据库,您不需要在阿拉伯字符之前放置 N。

于 2013-03-23T09:30:26.563 回答