Romanian Texts( ă ă Ă Â âÎ îŞ ş Ţ ţ) are not stored properly in SQl Server database

Question

Thursday, February 18, 2010 12:49 PM

Hi,
In my application im using romanian language texts also. but these romanian text(ă ă Ă   âÎ îŞ ş Ţ ţ) are not stored properly in the SQL database.
Im using the data type for that field as nvarchar and the collation as SQL_Latin1_General_CP1_CI_AS.

Can anyone help me to resolve this issue.

Thanks,
Mohan

All replies (5)

Thursday, February 18, 2010 2:28 PM ✅Answered

Mohan,

Everything seems to work fine for me, are you using the N prefix?

Edit: Anytime that work needs to be done with unicode character data in SQL Server, the literals must use the Nationality (N) prefix.

CREATE TABLE #NationalityTest
(
MyText  nvarchar(50)
)


INSERT INTO #NationalityTest VALUES (N'ă')
INSERT INTO #NationalityTest VALUES (N'Ă')
INSERT INTO #NationalityTest VALUES (N'âÎ')
INSERT INTO #NationalityTest VALUES (N'Ţ')
INSERT INTO #NationalityTest VALUES (N'ă ă Ă   âÎ îŞ ş Ţ ţ')


SELECT * FROM #NationalityTest

DROP TABLE #NationalityTest

Hope this helps,
Sean


Friday, February 19, 2010 7:04 PM

Hi Sean,
   Thank you for your reply.

I have checked Nationality (N) prefix. it has decalred as u mentioned. Still its showing only the characters

 âÎ 





others are not dispalyed as it is.

Friday, February 19, 2010 7:06 PM

the characters

ă ă Ă  are displayed a a A



the proper display is not coming in the select statement it self.

Monday, February 22, 2010 10:53 AM

Mohan,

Are you doing this through SQL Server Management Studio or through a client application? If you are using a client application it has to support unicode.

Hope this helps,
Sean


Saturday, September 15, 2012 3:21 PM

Hi Sean,

How can we do that from linq to sql? Is there a way?

Thx....