Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Server not reading Arabic

Status
Not open for further replies.

hanyniazy

Programmer
Oct 26, 2005
9
EG
Dear all
i have database mack by ERP Program Baan this database not reading arabic and colletion of DB
Latin_Gneral_BIN

and i change colliction of field to arabic but he write in field arbic but read it ?????????

what can i do to reading arabic?
 
Posting in English might help.

On a serious note, is the issue that you get an error when trying to return arabic characters. If the field is stored in nvarchar type and a specific collation is assigned using the COLLATE clause then you should be able to store and read arabic.



"I'm living so far beyond my income that we may almost be said to be living apart
 
What software are you using to read the data?

What datatype is the data being storred in? At kmckillop said it needs to be nvarchar (or nchar or ntext).

Can you post the code that is being used to insert the data into the database?

Denny
MCSA (2003) / MCDBA (SQL 2000)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
My datatype in feild is char

and i set colletion to arabic_bin but it not working
i can write in feild aric but when save return data

not reading arbic give to me ?????

and in anther database in this SQL server reading arabic

and software i using to read is SQL Query from SQL Sever

what can i do VIP
 
Change the field type to be nchar.

Char only stores ascii characters between 1 and 255 (have a look at help) but this doesnt include arabic characters.

You need to change from CHAR to be NCHAR which will then allow arabic characters.

"I'm living so far beyond my income that we may almost be said to be living apart
 
but i have anther db and all feild in it char and all faild reading arabic

and i can't change feild bucouse i work with anther system i want jast mack external report
 
If the field type is CHAR, it wont store arabic.
SO either you change the field type to be NCHAR, or you dont store arabic.

If you collection set to arabic, it still cant store these characters in the ASCII datatype CHAR. So even though you dont get an error putting in the info it still isnt storing it correctly.

Choice is yours.

Have a look at this test
Code:
create table Unicodetest (field1 char(1), field2 nchar(1))
insert into Unicodetest values (nchar(65212), nchar(65212))

select * from Unicodetest



"I'm living so far beyond my income that we may almost be said to be living apart
 
ok your test is work but how anther program reading arabic data without want to change it to nchar


this meaning that it have converting to araic do u know how?
 
When you say my test works, is both field1 and field2 the same value when displayed? and are both arabic characters based on your collation ?

If I am totally honest now, I dont understand what you are asking.

Do you want to translate to arabic, if so SQL wont do translations its only for data storage.


"I'm living so far beyond my income that we may almost be said to be living apart
 
Some background:

The reason that the CHAR datatype won't store Arabic is because the CHAR datatype only uses one btye of space per character to store the data on the disk. This means that there are only 255 possible characters that can be stored in the field. These characters cover the latin character set (plus a few extras). These are the characters used in the English language plus french, spanish, etc.

In order to store characters from other character sets you need to use the NCHAR data type. This data type uses two bytes per character to store the data on the disk. This allows for a much larger list of characters to be stored as now you can store any of ~65,025 characters.

You will notice that when using CHAR you can have up to 8000 characters in the field, but with NCHAR you can only have 4000. This is because with a NCHAR(4000) you are still taking up 8000 bytes of space on the disk and SQL only allows rows to be 8060 bytes per record.

In order to store characters from any language that does not use the Latin character set (no mater which collation type you select) you must use the NCHAR (or NVARCHAR or NTEXT) data types.

Denny
MCSA (2003) / MCDBA (SQL 2000)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
i want to answer about ur quation


field 1 datatype is char give to me ?

field 2 datatype is nchar give to me right value


but i have problem this not my db this db of big program ERP Baan and i can't change datatype of field and when i change data type in table the old data not back right

and this is anther problem


i jast make report to customer by Powerbuilder

and i want make this report without change datatype do u have any way to make this report
 
Without changing the datatype in the ERP system there will be no way to get the database to store or return non-latin characters.

Denny
MCSA (2003) / MCDBA (SQL 2000)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Without changing the datatype in the ERP system there will be no way to get the database to store or return non-Latin characters.

You'll want to contact the ERP vendor's support department to see if they know if the data types can be changed to support non-Latin (non-Engligh) characters.

Denny
MCSA (2003) / MCDBA (SQL 2000)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top