I'm inserting data (Bulk insert and merge update) for a Portuguese data source (CSV files) into my database. Although the DB collation is Latin1-General, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive for Unicode Data, SQL Server Sort Order 52 on Code Page 1252 for non-Unicode Data
and data stored in NVARCHAR
columns, the portuguese charaters are not correctly being saved.
i.e : Original Data
Regularização de Importação de mercadorias das ZEEs com Pagamento diferido, com Isenção
Data in database after insert
Regularização de Importação de mercadorias das ZEEs com Pagamento diferido, com Isenção
Here the import statement:
CREATE PROCEDURE [dbo].[SP_Import_Temp_CPC]
-- Add the parameters for the stored procedure here
@FilePath [nvarchar](1000)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
TRUNCATE TABLE Temp_CPC;
-- Insert statements for procedure here
EXEC ('BULK INSERT Temp_CPC
FROM ''' + @FilePath + '''
WITH ( FIELDTERMINATOR = ''<,>'', ROWTERMINATOR =''\n'', FIRSTROW = 2, KEEPIDENTITY, CODEPAGE = ''ACP'',TABLOCK,ORDER(ITEMID ASC) );');
END
I've tried with "ACP,RAW and OEM" but get the same result.
Am I doing something wrong here?
çã
is "Mojibake". It means that somewhere in the processing, you had not specifiedUTF-8
.