We help IT Professionals succeed at work.

Database allow foreign language

How can I make my database allow Arabic language character in sql server
Comment
Watch Question

Paul MacDonaldDirector, Information Systems

Commented:
Are you talking about storing Arabic words in a table?  Or are you talking about changing the interface to Arabic?

Which version of SQL Server are you using?

Author

Commented:
yup storing Arabic words but when i make query search or add or update  there is no output or the previous data be ??????? like this
Director, Information Systems
Commented:
You need to choose an Arabic collation for your varchar/char columns or use Unicode (nchar/nvarchar):

     CREATE TABLE #test
     (
     col1 VARCHAR(100) COLLATE Latin1_General_100_CI_AI,
     col2 VARCHAR(100) COLLATE Arabic_CI_AI_KS_WS,
     col3 NVARCHAR(100)
     )
     INSERT INTO #test VALUES(N'لا أتكلم العربية',N'لا أتكلم العربية',N'لا أتكلم العربية')
Note the N before values in insert statement above. If you do not mention it, system will treat the values as Varchar, not NVarchar.


     SELECT * FROM #test

Returns
     col1                           col2                           col3
     ------------------------------ ------------------------------ ------------------------------
     ?? ????? ???????               لا أتكلم العربية               لا أتكلم العربية
     

To see a list of Arabic collations use
     SELECT name, description
     FROM fn_helpcollations()
     WHERE name LIKE 'Arabic%'

More information here:
https://docs.microsoft.com/en-us/sql/relational-databases/collations/collation-and-unicode-support?view=sql-server-ver15
and here:
http://www.sqlerudition.com/how-to-store-non-english-unicode-characters-hindi-czech-arabic-etc-in-sql-server/

Author

Commented:
can i make this with existing Database?
Paul MacDonaldDirector, Information Systems

Commented:
I'm certain you can.  Be sure to read those links for detailed information.

Author

Commented:
Thanks ^_^

my sql query is

Alter TABLE [FZMain] ALTER column
	
	[NAME] VARCHAR(100) COLLATE Arabic_CI_AI_KS_WS 
	[Cases] VARCHAR(100) COLLATE Arabic_CI_AI_KS_WS	
	[LastOwner] VARCHAR(100) COLLATE Arabic_CI_AI_KS_WS

Open in new window

Paul MacDonaldDirector, Information Systems

Commented:
Happy to help.  Thank you for the points.