Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Aaron_Liu
Partner - Contributor III
Partner - Contributor III

Try to sync .csv file to ms sql

Hi Sirs,

My customer want to add a new file(.csv file) as source and they has custom code page word , I was generated a .csv file to sync to MS SQL(that .csv file as attachment include custom code page word) , but the custom code page word not success sync.

Please see the attachment file 'test_customcodepage.jpg' and 'EndPoint_Setting.jpg' and 'Column_Setting.jpg' and 'SQL_QueryResult.jpg'

Please tell us how to solve this problem.
Thanks.
Aaron 2024-2-21

Labels (1)
2 Solutions

Accepted Solutions
john_wang
Support
Support

Hi @Aaron_Liu ,

This is because your source file is inaccurate. There are no valid UTF8 Chinese chars.

I've made a sample file with UTF8 encoding file and it works for me, replicate from File Source to SQL Server target, the Chinese chars are replicated correctly:

john_wang_0-1708525095674.png

Regards,

John.

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!

View solution in original post

DesmondWOO
Support
Support

Hi @Aaron_Liu ,

My Windows is using Chinese (Hong Kong SAR) language. Open your test_customcodepage.csv, Chinese characters are shown as below:

DesmondWOO_0-1708579573048.png

So your customized Chinese characters overlap the code points which are defined in the HK codepages.

I ran Replicate to load above Chinese characters into NVARCHAR. Result is as below:

DesmondWOO_2-1708596074824.png

If your system doesn't haven customized font, you won't be able to display those Chinese characters. To verify, you may use  master.dbo.fn_varbintohexstr(CAST([column_name] AS varbinary)) to check the hex values of records.

Regards,
Desmond

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!

View solution in original post

8 Replies
john_wang
Support
Support

Hello @Aaron_Liu ,

Thanks for reaching out to Qlik Community!

I do not see the file contains Chinese chars. Could you please check with that file codepage and what's the chars? BIG5 chars? or something else.

Thanks,

John.

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!
Aaron_Liu
Partner - Contributor III
Partner - Contributor III
Author

Hi John,

It is used UTF-8 chars. I reload the file as attachment. (or You can see the test_customcodepage.jpg)

Thanks.

Aaron 2024-2-21

john_wang
Support
Support

Hi @Aaron_Liu ,

This is because your source file is inaccurate. There are no valid UTF8 Chinese chars.

I've made a sample file with UTF8 encoding file and it works for me, replicate from File Source to SQL Server target, the Chinese chars are replicated correctly:

john_wang_0-1708525095674.png

Regards,

John.

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!
Aaron_Liu
Partner - Contributor III
Partner - Contributor III
Author

Hi John,

I try other normally chinese word, it is success to sync to MS SQL.as below pic

2024-02-22_112149.jpg

Original "test_customcodepage.csv" include the custom code page word (難字/自造字) that was in utf-8 scope. but those word cannot sync to MS SQL. as below pic

2024-02-22_112250.jpg

Thanks.
Aaron 2024-2-22

john_wang
Support
Support

Hello @Aaron_Liu ,

Thanks for the feedback. Are you able to write these chars (難字/自造字) into SQL Server manually? By any ODBC tools , or SSMS.

Regards,

John.

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!
DesmondWOO
Support
Support

Hi @Aaron_Liu ,

My Windows is using Chinese (Hong Kong SAR) language. Open your test_customcodepage.csv, Chinese characters are shown as below:

DesmondWOO_0-1708579573048.png

So your customized Chinese characters overlap the code points which are defined in the HK codepages.

I ran Replicate to load above Chinese characters into NVARCHAR. Result is as below:

DesmondWOO_2-1708596074824.png

If your system doesn't haven customized font, you won't be able to display those Chinese characters. To verify, you may use  master.dbo.fn_varbintohexstr(CAST([column_name] AS varbinary)) to check the hex values of records.

Regards,
Desmond

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!
Aaron_Liu
Partner - Contributor III
Partner - Contributor III
Author

Hi John, Hi Desmond,

Thanks for your reply. You are right!! My designe test case data has inaccurate, because original CSV file content customized Chinese characters was copy and paste from other file, discuss with Gavin who said that's wrong doing, should be "type" into the CSV file, not used copy and paste.

So I re-gen a CSV file as attachment that was sync success.

sync_success.jpg

Thanks for your support!!!

Aaron 2024-2-23

john_wang
Support
Support

Hello @Aaron_Liu ,

Thanks for your new demo file. Now it works in my labs. After replicated to SQL Server target I got the chars/graphics correctly:

john_wang_0-1708696867987.png

Feel free to let us know if you need any additional assistance.

Good luck,

John.

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!