Q:

How to set encoding parameter for SQL Server Bulk statement?

I wrote this SQL Server Bulk script:
BULK INSERT dbo.test
   FROM 'd:\1.csv'
   WITH(
        FIELDTERMINATOR =','

      );

But my CSV file should be encode with this encoding system:
Encoding.GetEncoding(1256)

How can I apply up code to that Bulk script?

A:

CodePage is what you're looking for. You might also need a RowTerminator value set.
BULK INSERT dbo.test
FROM 'd:\1.csv'
WITH(
    FIELDTERMINATOR = ',',
    ROWTERMINATOR = '\n',
    CODEPAGE = '1256'
  );

