0

I used bulk insert into SQL Server Management Studio 2008 R2, 10 words from a text UTF-8 file, into single column.

However, the words do not appear correctly, I get extra space in front of some words.

Note: None of the answers have solved my problem, so far. :(

SCREENSHOT OF THE PROBLEM

3 Answers3

0

This issue may occur if you are not using the correct collation (language settings). You need to use the appropriate collation in order to display your data in the correct format. See the link http://technet.microsoft.com/en-us/library/ms187582(v=sql.105).aspx for more details.

0

Look at this post How to write UTF-8 characters using bulk insert in SQL Server?

Quote: You can't. You should first use a N type data field, convert your file to UTF-16 and then import it. The database does not support UTF-8.

Original answers

look at the encoding of youre text file. Should be utf8. If not this could cause problems.

Open with notepad, file-> save as and choose encoding

After this try to import as a bulk

secondly, make sure the column datatype is nvarchar and not varchar. Also see here

Community
  • 1
  • 1
lordkain
  • 3,061
  • 1
  • 13
  • 18
0

You can also try using a different row terminator:

bulk insert table_name
from 'filename.txt' WITH (ROWTERMINATOR='\n')
Szymon
  • 42,577
  • 16
  • 96
  • 114
  • Can you also try different `DATAFILETYPE` and `CODEPAGE` options as described in here: http://technet.microsoft.com/en-us/library/ms188365(v=sql.100).aspx – Szymon Sep 25 '13 at 03:40