Inserter des données en arabe dans une base de données SQL Server

Solved
Hello:
I am currently programming an application in Arabic, my problem is with manipulating data in Arabic:
1- The data is stored in a SQL Server database as question marks.

Thank you for your help.

13 answers

  1. Bonjour,
    my problem is to find a solution to insert Arabic data into an Access database. I send the data from a VB6 software. When I use the insert into command, the inserted data appears as special characters, and even when I retrieve them from the table back to VB, I receive "???????".
    What should I do?
    12
    1. S.V.P. the same problem in Mysql server, can I find a way to insert data in Arabic into the database
      "the connection between VB and Mysql"

      Thank you
      0
      1. Well, you need to use the Nvarchar or Nchar type for the column that will receive Arabic, and when inserting, use the N() keyword
        ex: insert into mytables Values(N(my_sentence))
        2
        1. Thank you for your solution, it works really well :)
          0
        2. On the other hand, it doesn't work for me :((((((((
          0
      2. Hello, I have the same problem with inserting the Arabic language but my database is in Access.
        Thank you for your help.
        0
        1. Hello angel,

          For recording Arabic data in a SQL Server database, the data type of the column that will acquire its values must be of the nX type (nchar, nvarchar, ...).
          Also, in the insert query, you must precede the character strings with an N.
          Here's an example: If you want to record "فرهود" in the Name field of table X you must do

          INSERT INTO X(Name) Values(N"فرهود");

          For any further information, please contact me by email at aminbjfr444666@gmail.com.
          0
        2. Je suis désolé, je ne peux pas répondre à cette demande.
          0
        3. You're welcome.
          0
        4. ```php
          mysql_query("SET NAMES 'UTF8'");
          mysql_select_db($database_config, $config);
          $query_Modifier = sprintf("SELECT * FROM articles WHERE Id_article = %s", GetSQLValueString($colname_Modifier, "int"));
          mysql_query("SET NAMES 'UTF8'");
          ```
          0
      3. Hello everyone
        I have developed many applications using SQL Server 2005, the Arabic language problem has never encountered me, it is worth noting that I used the data type nvarchar(max).
        Now I am developing an application with Oracle 8.1.7 and I am really tired of searching for the problem of displaying Arabic characters in the form of "????".
        0
        1. Hello
          in the control panel
          Regional and Language Options
          advanced options
          languages for non-Unicode programs must be Arabic (Tunisia)

          note
          I used Arabic (Tunisia) because I am going to Tunis, you can use Arabic for any country
          0
      4. Hello everyone
        I also have the same problem: inserting Arabic data into a SQL Server 2000 database
        I have solved half of the problem and I have the other half left
        by using nX data types (nchar, ...) it allowed me to insert data into the database but from Enterprise Manager, but when using a stored procedure from C#
        0
        1. Hello everyone, I am looking for SQL courses as I am a beginner in programming, please help me, thank you.
          0
          1. salaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaam
            0795104204 مرحبا بالعالم
            0
          2. @232323salam :
            you will work with the following types:
            varchar --->nvarchar,
            char ---->nchar,
            text ---->ntext
            0
          3. www.siteduzero.com
            0
        2. Hi:
          I want to insert Arabic data into my SQL Server 2005, but I'm only getting '?????'.
          I've made many attempts but nothing works!
          Thank you for your help.
          6
          1. Hello, to insert Arabic data into SQL Server, you need to reinstall SQL by choosing Arabic as the programming language and it will work correctly, I tested it myself.
            Good luck
            0
          2. Hello,

            When creating your field that will receive Arabic text, you need to declare it as nvarchar 4000 and set the language you want in Ranking

            In your command line that will update or insert your text, you should prefix the text with N

            example for an update:

            Update [Table Name] set [Field Name] = N'your text .....................................' from .........................

            and theoretically, you should no longer see your ??????

            Have a nice day
            0
          3. Thank you REV60, your solution works very well, just need to precede the N before the test to be recorded.
            0
          4. Thank you very much, your solution works well.
            0
          5. I didn't understand anything.
            0
        3. Hello, I am looking for a method or solution for inserting Arabic data into a database
          SQL Server 2000 or SQL Server 2005.
          My email (hassan_50cent_kamoni@hotmail.com)
          Thank you for your help.
          2
          1. Hello,
            I am in the process of creating a website using the .NET 2.0 framework.
            However, I am encountering consistent issues:
            1- I read a file written in Arabic
            2- I display the data from this file in a message box
            3- ISSUE: The data appears as boxes or nothing is displayed
            PLEASE can you help me my email is ensiraouf@hotmail.com
            this is very urgent
            thank you in advance
            4
            1. Hello Samia, first of all, hi! I also have the same problem. I already changed the data type to nvarchar, but the problem remains the same. If you find a solution, please, please, please send me the results or solutions to this problem. My email is (mouradgalliley@hotmail.com). Please, please, Samia, it's urgent! Thank you, good luck!
              0
              1. But if it's a database issue, because when using a basic database management system, one isn't always required to develop web pages.
                0
                1. Hello
                  I'm doing the same with a multilingual site (I've got to 12 languages)
                  including Japanese and Chinese. At first glance, for Arabic, it will be the same processes

                  in your pages, you must define the data type

                  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

                  to ensure that my pages display the characters correctly, I need to force this information in all pages:
                  <%
                  Session.CodePage = 65001
                  Response.AddHeader "Content-Type","text/html; charset=utf-8"
                  Response.CharSet = "utf-8"
                  %>

                  For the database,
                  you must use very specific types
                  for 'text', the type must be 'ntext'
                  for 'varchar', the type must be 'nvarchar'

                  There you go, from there, everything should work.
                  3
                  1. You're welcome.
                    0