0

I'm trying to convert an excel file to sql. but i'm getting below error. enter image description here

when i change on truncation value to "ignore" , the convert process will be complete but persian characters will be seen as "?".

Behnam
  • 1,039
  • 2
  • 14
  • 39
  • 5
    Are the destination columns NVARCHAR? They should be if they're going to accept unicode text. – rory.ap Nov 12 '14 at 13:14
  • it is varchar not nvarchar. is it the reason? – Behnam Nov 12 '14 at 13:17
  • 1
    I think I already answered that question in my comment. – rory.ap Nov 12 '14 at 13:18
  • so please help me for next problem. i want to change destaination type from varchar to nvarchar but my table has some Foreign Keys. so i can't drop and recreate my table. – Behnam Nov 12 '14 at 13:25
  • Well, I'm not exactly sure about that one, sorry. But either way, that's a different question and should be a new post per Stack Overflow rules. – rory.ap Nov 12 '14 at 13:43
  • Could you please write your comment as answer so I could select an answer? – Behnam Nov 12 '14 at 16:58

2 Answers2

1

Make sure that all your destination columns are NVARCHAR if they are going to be accepting Unicode text.

See here for a detailed explanation: What is the difference between varchar and nvarchar?

Community
  • 1
  • 1
rory.ap
  • 34,009
  • 10
  • 83
  • 174
0

As you know, import excel files to SQL server database is doing by Access Engine, in most of the cases that you see this error, it could be solved by below method:

At first, you create an access file and save it in MDB format (this format could be used in SQL server), and then import your excel file to this Access.mdb file, when all your data is complete, you can import this MDB file from the SQL server to your database,