1

I have excel which has data like below

2015.0230
2015.1100
2015.9000

I'm using Wizard [import export] to load these values to DB table. However, after loading, it come like below:

2015.023
2015.11
2015.9

When I'm converting this to char or nvarchar, its throwing error:

Unknown conversion from double to nvarchar

What datatype should I consider? Is there any ways so that such thing can be done via SSIS?

The result I wanted in DB table should be same as excel file.

Hadi
  • 36,233
  • 13
  • 65
  • 124
AskMe
  • 2,495
  • 8
  • 49
  • 102
  • 1
    You can use SSIS and read the value directly as a string type but beware that the actual value might differ from what Excel shows you. You can also treat them as a numeric and add your trailing zeroes using SQL, if they are always up to 4th decimal. – EzLo May 31 '19 at 09:40
  • They are the same number. The rest is just formatting. If you want to store a number in SQL, forget about formatting. You haven't included the code that throws that error or the datatype that you are loading into so it's anyone's guess what is going on – Nick.Mc May 31 '19 at 10:25
  • First, ensure that the data in excel is stored as TEXT. – Khal_Drogo Jun 03 '19 at 20:22

0 Answers0