How to store Non-English Characters into SQL Table?

Ramana Kopparapu 306 Reputation points
2023-12-27T00:37:32.1666667+00:00

Hi,

I have a table called Person_Data where 4 columns. Column3 has NVARCHAR(200) data type in which I want to store both English and Non-English data.

When I trying to Insert values manually into the table with preceding N' like below:

INSERT INTO dbo.Person_Data

( Col1, Col2, Col3, Col4)

VALUES (123, ABC, N'元気ですか', NULL)

Non -English characters loaded perfectly and successfully.

When I remove N' while inserting, i will get question marks (?) instead of Non-English.

I want to get Non-English value as it is.

I have CSV file having thousands of rows consisting this data. Is it possible to create SSIS package or any other alternative to load Non-English characters?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,494 questions
SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,676 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Dan Guzman 9,371 Reputation points
    2023-12-27T01:30:02.21+00:00

    I have CSV file having thousands of rows consisting this data. Is it possible to create SSIS package or any other alternative to load Non-English characters?

    Parameterized queries are typically used in SSIS and application code. This will preserve non-ANSI characters as long as parameter definitions specify data type nvarchar. The N prefix needed in T-SQL constants to denote a string of national characters does not apply to parameters.

    SSIS will detect the nvarchar column type at design time with a OLE DB destination and parameterize the bulk insert accordingly.

    0 comments No comments

  2. ZoeHui-MSFT 41,446 Reputation points
    2023-12-27T01:55:25.48+00:00

    Hi @Ramana Kopparapu,

    First of all make sure that your CSV files are in the Unicode encoding (try to open CSV file in the Notepad-> Save As -> and check Encoding in the bottom). If they are not - save them in Unicode

    User's image

    And make sure that in the properties inside SSIS packege the check box is selectedFlat File SourceUnicode

    User's image

    Regards,

    Zoe Hui


    If the answer is helpful, please click "Accept Answer" and upvote it.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.