Pergunta

Eu tenho uma consulta como esta

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`)

Quando eu substituir XXXXXX com ????? ???? ???????? ???????, a consulta após as voltas da corda direita para a esquerda como este

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)

Por favor me diga como superar isso.

Eu estou usando servidor SQL 2000 MSDE.

Foi útil?

Solução 2

Este problema é resolvido quando adicionamos N antes do valor 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)

Outras dicas

Você pode resolver este caso adicionando o letra N antes cada valores inseridos (que a conversão necessidade)

Por exemplo:

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');
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top