插入阿拉伯字符时,SQL查询排列变化

我有这样一个查询

SET QUOTED_IDENTIFIER OFF SET DATEFORMAT 'mdy' INSERT INTO TABLE1 (AccountID, TimeStamp, UserID, NodeID, Deleted, UserPriority, ParentRecordID, NodeLevel, Name, NodeClass, DeviceID, DeviceType, SubTypeLevel) VALUES (0, "10/03/2002 02:33:39", 0, 0, 0, 0, 0, 0,"XXXXXX",7000, 0, 0, 0`)

当我替换XXXXXX与منطقةتحكمبالبدايةالسريعة,后弦的查询变为从右到左是这样

SET QUOTED_IDENTIFIER OFF SET DATEFORMAT 'mdy' INSERT INTO TABLE1 (AccountID, TimeStamp, UserID, NodeID, Deleted, UserPriority, ParentRecordID, NodeLevel, Name, NodeClass, DeviceID, DeviceType, SubTypeLevel) VALUES (0, "10/03/2002 02:33:39", 0, 0, 0, 0, 0, 0, "منطقة تحكم بالبداية السريعة", 7000, 0, 0, 0)

请告诉我如何克服这一点。

我使用SQL Server 2000 MSDE。

--------------解决方案-------------

您可以通过添加字母 N解决这种情况下,每个输入值之前 (即需要转换)

例如:

INSERT INTO TABLE1(AccountID, TimeStamp, UserID, NodeID, Deleted, UserPriority,
ParentRecordID, NodeLevel, Name, NodeClass, DeviceID, DeviceType, SubTypeLevel)
VALUES
(0, "10/03/2002 02:33:39", 0, 0, 0, 0, 0, 0, "منطقة تحكم بالبداية السريعة"N, 7000, 0, 0, 0)

=>

Insert ... Into ... Values (id1,id2,..., N'Arabic word',N'Hebrew word',N'Chinese word');

当我们将nvarchar的值之前加正这个问题就解决了​​。

SET QUOTED_IDENTIFIER OFF SET DATEFORMAT 'mdy' INSERT INTO ControlTreeEx (AccountID, TimeStamp, UserID, NodeID, Deleted, UserPriority, ParentRecordID, NodeLevel, Name, NodeClass, DeviceID, DeviceType, SubTypeLevel) VALUES (0, "10/03/2002 02:33:39", 0, 0, 0, 0, 0, 0, N'منطقة تحكم بالبداية', 7000, 0, 0, 0)

分类:SQL 时间:2012-11-20 人气:0
本文关键词: SQL,MSDE,阿拉伯语
分享到:

相关文章

Copyright (C) 55228885.com, All Rights Reserved.

55228885 版权所有 京ICP备15002868号

processed in 0.613 (s). 10 q(s)