Solved

Import excel spreadsheet into Sql Server schema - numbers become exponentials: Why? Fix?

Posted on 2007-04-09
4
2,083 Views
Last Modified: 2008-02-14
I have an excel spreadsheet that I import into a table in a SQL server schema. Once I import it, all the data appears perfectly EXCEPT a column (record_num), which has 6-8 digit numbers. On the Excel sheet this column displays the numbers just fine, but once I import it into a SQL table, the data in that column looks like this : "2.12043e+006" (instead of 2120426)

Now I looked at the SQL table's design and the data type is set to "varchar: 100"

If I re-format the column in excel as general, text, or number - I still get exponentials instead of the ACTUAL 6 or 8 digit number.

What am I missing? There's over 400 rows of data.
0
Comment
Question by:super786
  • 2
4 Comments
 
LVL 35

Expert Comment

by:YZlat
ID: 18876769
before inserting, format excel column as integer instead of text or general
0
 
LVL 16

Expert Comment

by:MohanKNair
ID: 18876802
Is SQL SERVER check how other number columns with large values are displayed. Change setting of SQL SERVER Database.
0
 
LVL 1

Author Comment

by:super786
ID: 18877588
Ok now its giving me another error. Seems as though now the record_num is working fine (I changed it to text). But the other problem I am having now is the date_column. My SQL design for the table for this column is datetime :8, as it also is on the spreadsheet. I try and import it and now it says the date_column is in incorrect format. I tried text, general...no help. I tried saving it as csv, but still doesn't work.

0
 
LVL 1

Accepted Solution

by:
super786 earned 0 total points
ID: 18877595
Oh and changing the design in of the SQL table is not an option (company rule)
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now