I am importing data from an excel worksheet in to a sql table,
one of the columns in the table is set to nvarchar(50), the data i am importing are barcodes, but the problem i am having is the column is changing the data
for example the number "5900397732209" is converted to "5.9004e+012" this is only happening when the data is imported.
if i save the barcode direct from my software it shows in the correct format in the table.
anyone know why this is.

Recommended Answers

All 4 Replies

Excel is formatting the number. Open excel and set the desired format for those columns.

First select the column:


Next set the formatting:


Click okay and you are finished!


hi,thanks for the reply
I already formatted the cells on the excel sheet to the number format with no decimal spaces but it was still the same, initially when you import the data it is set as "float" in sql at this point the number is in full but as soon as i change it to nvarchar it changes it,

After a quick google session using keywords I found this article. Maybe it is what you are looking for! :)

tried many things , but in the end i just copied and pasted the data into excel and it seems to be fine.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.