Forum Discussion
Scandic Characters not supported in SQL Server
- Oct 12, 2018
Hi,
The issue is resolved now. I thought it would be beneficial for someone like me having the same issue.Therefore, i am posting the solution.
It was actually related to the encoding of the file. The json file i was using was in UTF-8. It was causing the problem as SQL Server 2017 doesn't support UTF-8 characters. Therefore, i used Azure Data Factory CopyActivity to transfer the file in UTF-8 to file in UTF-16 using source and sink "ENCODING NAME" in copy activity. The desired file was in UTF-16 now.
After that i made very small change in the script as follows:
select gender
from OPENROWSET(bulk 'abc/testJsonFile.json',DATA_SOURCE='MyAzureBlobStorage',single_nclob) as j
cross apply OPENJSON(BulkColumn)
WITH (
gender nvarchar(200) N'$.gender'
);I changed single_clob to single_nclob as the specified file was unicode.
And, it worked fine.
Thanks.
Hi,
The issue is resolved now. I thought it would be beneficial for someone like me having the same issue.Therefore, i am posting the solution.
It was actually related to the encoding of the file. The json file i was using was in UTF-8. It was causing the problem as SQL Server 2017 doesn't support UTF-8 characters. Therefore, i used Azure Data Factory CopyActivity to transfer the file in UTF-8 to file in UTF-16 using source and sink "ENCODING NAME" in copy activity. The desired file was in UTF-16 now.
After that i made very small change in the script as follows:
select gender
from OPENROWSET(bulk 'abc/testJsonFile.json',DATA_SOURCE='MyAzureBlobStorage',single_nclob) as j
cross apply OPENJSON(BulkColumn)
WITH (
gender nvarchar(200) N'$.gender'
);
I changed single_clob to single_nclob as the specified file was unicode.
And, it worked fine.
Thanks.