jQuery in Action, 2nd edition*
The moose likes JDBC and the fly likes  Arabic characters in MS sql Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark " Arabic characters in MS sql" Watch " Arabic characters in MS sql" New topic
Author

Arabic characters in MS sql

Sherif Shehab
Ranch Hand

Joined: Mar 05, 2007
Posts: 483

Hi Guys ,

Is there a way to store Arabic characters in MS sql , because i;m trying to insert now arabic but it appears as "?"
PS: i don't wanna reinstall the MS sql


Thanks,
Sherif
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Hi there,

It's possible yes, you really need to read this


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Sherif Shehab
Ranch Hand

Joined: Mar 05, 2007
Posts: 483

Martijn Verburg wrote:Hi there,

It's possible yes, you really need to read this


Hi ,

the problem is that when you try to preview the data written in arabic from sql client you will find it "?" , so i searched how to solve this all the solutions i found to uninstall the MS sql then change the regional setting to arabic then install MS sql again , but i dont wanna do that , i wanna s solution to see these arabic character with out uninstall
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Did you read the article? It is a fairly comprehensive description of what is causing your problem.

You shouldn't need to uninstall the SQL Server client tools (and certainly you don't need to uninstall SQL Server it supports Arabic fine). Microsoft applications will all pick up the regional settings if you change them without needing reinstalled.

Assuming your data model uses a unicode data type to store the data and your client can support Arabic you should be able to see it fine.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19799
    
  20

You may have to change the collation of your database. By default it is probably set to some Latin1 collection (e.g. SQL_Latin1_General_CP1_CI_AS).

Moving to JDBC.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

This shouldn't matter. The collation only applies to text manipulation logic (sorting and the like) and shouldn't affect the underlying data - unless you use a TSQL function that also relies on the collation to manipulate the data. For example I'm currently looking at Arabic data in a SQL Server instance that has a Latin1_General_CI_AS collation.
 
jQuery in Action, 2nd edition
 
subject: Arabic characters in MS sql