locked
Inserting Arabic characters into a column RRS feed

  • Question

  • Hi,
        I am trying to insert some arabic characters into one of the tables but after I insert it, it get stored as ?????. What should I do? I have SQL Sever Managment Studio Express running on Windows XP. I appreciate any suggestions!!

    Thanks
    Monday, February 19, 2007 5:08 PM

Answers

  • Its an old thread...Still....OP is finding issue on typing the english character between arabic words because the Arabic letter writing is from RIGHT to LEFT. So the order of words would be different from ENGLISH writing.

    create Table Test_Arabic(Testcol nvarchar(max),testcol2 int)
    Insert into Test_Arabic values(N'صباح الخير',435)
    
    Select * From Test_Arabic
    
    Drop table test_Arabic


    Friday, February 7, 2014 8:56 AM
    Answerer

All replies

  • Two possible reasons I can think of:

    1. the column is not defined as unicode data type (need to use nvarchar instead of varchar for example)
    2. the string was not led by the special char N (e.g. need to use N'chars' instead of just 'chars')

    Thursday, February 22, 2007 10:23 PM
  • Hi,
       Thanks Hugh, I tried the second option and it worked alright. However, I am facing another problem which is when I write the arabic text inside the SQL statement and then switch to English my query get missed up especially when i enter a nubmer after an arabic text, such as:

    Values(N'arabic text', 435) for some reason the order get missed up. Anyhow, thanks alot for your advice.
    Saturday, February 24, 2007 1:36 PM
  • Barradah,

    Is this still an issue?

    Thank you!


    Ed Price, Power BI & SQL Server Customer Program Manager (Blog, Small Basic, Wiki Ninjas, Wiki)

    Answer an interesting question? Create a wiki article about it!

    Friday, February 7, 2014 7:57 AM
  • Its an old thread...Still....OP is finding issue on typing the english character between arabic words because the Arabic letter writing is from RIGHT to LEFT. So the order of words would be different from ENGLISH writing.

    create Table Test_Arabic(Testcol nvarchar(max),testcol2 int)
    Insert into Test_Arabic values(N'صباح الخير',435)
    
    Select * From Test_Arabic
    
    Drop table test_Arabic


    Friday, February 7, 2014 8:56 AM
    Answerer