Amira Elsayed Ismail
Amira Elsayed Ismail

Reputation: 9394

Problem with SQL Collation

I'm making an Arabic website , and after I create the database and start writing Arabic text inside it , it just show ???? , so I change the collation of my Database from SQL_Latien to Arabic_CI_AI

but I'm still getting the ???? inside my fields and when I check the properties of the field I found it SQL_Latien and it doesn't change

so what should I do to fix this problem without repeating building the database

please reply as soon as you can

Thanks in Advance

Upvotes: 0

Views: 1037

Answers (2)

Marwan
Marwan

Reputation: 1058

The collation sequence is the order in which characters appear when you sort (ie. use the 'ORDER BY' clause). Different collations will result in different sort orders.
This is obviously NOT what you are looking for. You problem is storing and retrieving UNICODE characters outside the ASCII range (ie. Arabic characters). To do that, the data types storing this data must support UNICODE, instead of ASCII. Simply, when defining a column, use the data types nchar, nvarchar, and ntext, instead of char, varchar and text.

Upvotes: 0

Andomar
Andomar

Reputation: 238086

Database collation is just the default setting for new columns.

To change the collation of an existing column, you'd have to alter table. For example:

alter table YourTable alter column col1 varchar(10) collate Arabic_CI_AI

Upvotes: 1

Related Questions