Click here to Skip to main content
15,880,299 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello experts, Which data type we should take if we want to store UNICODE text in a field of a database table, say name of a person in devnagri.

In MS-Access, i have taken the field type 'Text' and it works, but the same does not work in SQL Server 2005.

My OS is Windows 7 ultimate. 64 bit

thanks in advance.


You need to use collation[^]
COLLATE Indic_General_90_CI_AS
Share this answer
Take the Field Data Type as nvarchar(len)

where len is the field length

prefix the value of the field with 'N' while inserting, like

strQuery = "INSERT INTO TableName( Col1, Col2, Col3) VALUES (" +
                   "\'" + Val1 + "\'," +
                   "\'" + Val2 + "\'," +
                   "N\'"+ val3 + "\')";

notice the N before the value of col3. as seen above,
in the above code segment, Col3 has Unicode Text.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900