I have a SQL Server table that contains columns of type varchar(MAX)
and I'm trying to get a .csv
(UTF-8) type export but I get this error instead.
I want to know how I can change this data type to nvarchar(MAX)
without losing data. Can anyone help?
Messages
Error 0xc00470d4: Data Flow Task 1: The code page on Destination - test_csv.Inputs[Flat File Destination Input].Columns[test1] is 1252 and is required to be 65001.
(SQL Server Import and Export Wizard)
Error 0xc00470d4: Data Flow Task 1: The code page on Destination - test_csv.Inputs[Flat File Destination Input].Columns[test2] is 1252 and is required to be 65001.
(SQL Server Import and Export Wizard)
(many more of the same error - for each column)
Error 0xc004700c: Data Flow Task 1: One or more component failed validation.
(SQL Server Import and Export Wizard)
Error 0xc0024107: Data Flow Task 1: There were errors during task validation.
(SQL Server Import and Export Wizard)
I have looked into similar questions , where I have the same problem but I don't know how to use CAST or CONVERT in the query
2条答案
按热度按时间67up9zun1#
You can solve this in 3 ways:
NVARCHAR
in the initialSELECT
, e.g.CAST(mycolumn as nvarchar(column_length))
(65001 Code page = Unicode (UTF-8))
You might find that the 3rd option is easiest.
zpjtge222#
You should enable Unicode with the checkbox next to the Locale: