SQL cambiamento di allineamento query quando vengono inseriti i caratteri arabi

StackOverflow https://stackoverflow.com/questions/2226877

  •  19-09-2019
  •  | 
  •  

Domanda

Ho una domanda del genere

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

Se si sostituisce XXXXXX con منطقة تحكم بالبداية السريعة, la query dopo la stringa gira da destra a sinistra come questo

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)

Ti prego, dimmi come superare questo.

Sto usando SQL Server 2000 MSDE.

È stato utile?

Soluzione 2

Il problema è stato risolto quando aggiungiamo N prima del valore 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)

Altri suggerimenti

È possibile risolvere questo caso con l'aggiunta del lettera N prima Ogni valori immessi (che la conversione necessità)

Ad esempio:

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');
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top