3 added 140 characters in body
source | link

SQL Server 2008 does not support UTF-8 natively prior to SQL Server 2019.

So how can you import your data correctly?

  1. Convert your data to UTF-16 prior to your insert
  2. Upgrade to SQL Server 2014 (SP2) or above and take advantage of code page 65001 in the bulk insert statement as below

    BULK INSERT #table
    
    FROM  'C:\MyFile.csv'+ WITH 
    
    ( 
        CODEPAGE = '65001',
        FIELDTERMINATOR = ',',
        ROWTERMINATOR ='\n'
    );
    
  3. Since UTF-8 is an encoding style, not a collation, store the data as VARBINARY and decode it in the front-end rather than the database.

SQL Server 2008 does not support UTF-8 natively prior to SQL Server 2019.

So how can you import your data correctly?

  1. Convert your data to UTF-16 prior to your insert
  2. Upgrade to SQL Server 2014 (SP2) or above and take advantage of code page 65001 in the bulk insert statement as below

    BULK INSERT #table
    
    FROM  'C:\MyFile.csv'+ WITH 
    
    ( 
        CODEPAGE = '65001',
        FIELDTERMINATOR = ',',
        ROWTERMINATOR ='\n'
    );
    

SQL Server 2008 does not support UTF-8 natively prior to SQL Server 2019.

So how can you import your data correctly?

  1. Convert your data to UTF-16 prior to your insert
  2. Upgrade to SQL Server 2014 (SP2) or above and take advantage of code page 65001 in the bulk insert statement as below

    BULK INSERT #table
    
    FROM  'C:\MyFile.csv'+ WITH 
    
    ( 
        CODEPAGE = '65001',
        FIELDTERMINATOR = ',',
        ROWTERMINATOR ='\n'
    );
    
  3. Since UTF-8 is an encoding style, not a collation, store the data as VARBINARY and decode it in the front-end rather than the database.

2 added 36 characters in body
source | link

SQL Server 2008 does not support UTF-8 natively prior to SQL Server 2019.

So how can you import your data correctly?

  1. Convert your data to UTF-16 prior to your insert
  2. Upgrade to SQL Server 2014 (SP2) or above and take advantage of code page 65001 in the bulk insert statement as below

    BULK INSERT #table

    FROM 'C:\MyFile.csv'+ WITH

    ( CODEPAGE = '65001', FIELDTERMINATOR = ',', ROWTERMINATOR ='\n' );

    BULK INSERT #table
    
    FROM  'C:\MyFile.csv'+ WITH 
    
    ( 
        CODEPAGE = '65001',
        FIELDTERMINATOR = ',',
        ROWTERMINATOR ='\n'
    );
    

SQL Server 2008 does not support UTF-8 natively prior to SQL Server 2019.

So how can you import your data correctly?

  1. Convert your data to UTF-16 prior to your insert
  2. Upgrade to SQL Server 2014 (SP2) or above and take advantage of code page 65001 in the bulk insert statement as below

    BULK INSERT #table

    FROM 'C:\MyFile.csv'+ WITH

    ( CODEPAGE = '65001', FIELDTERMINATOR = ',', ROWTERMINATOR ='\n' );

SQL Server 2008 does not support UTF-8 natively prior to SQL Server 2019.

So how can you import your data correctly?

  1. Convert your data to UTF-16 prior to your insert
  2. Upgrade to SQL Server 2014 (SP2) or above and take advantage of code page 65001 in the bulk insert statement as below

    BULK INSERT #table
    
    FROM  'C:\MyFile.csv'+ WITH 
    
    ( 
        CODEPAGE = '65001',
        FIELDTERMINATOR = ',',
        ROWTERMINATOR ='\n'
    );
    
1
source | link

SQL Server 2008 does not support UTF-8 natively prior to SQL Server 2019.

So how can you import your data correctly?

  1. Convert your data to UTF-16 prior to your insert
  2. Upgrade to SQL Server 2014 (SP2) or above and take advantage of code page 65001 in the bulk insert statement as below

    BULK INSERT #table

    FROM 'C:\MyFile.csv'+ WITH

    ( CODEPAGE = '65001', FIELDTERMINATOR = ',', ROWTERMINATOR ='\n' );