473,507 Members | 2,447 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

scientific notation to original numbers

1 New Member
I have uploaded an excel file in sql server 2005 and that file contains some phone numbers in field phonenum nvarchar(50) some of which have been converted to scientific notation due to cell width and stored as scientific notation in sql server database.

how can i convert those numbers to original phone numbers using sql server.

Help in in this regard as soon as possible.

Thanks :
Neetu
Aug 29 '11 #1
5 4403
NeoPa
32,557 Recognized Expert Moderator MVP
I suggest a better question would be how to import the numbers properly in the first place.

Scientific notation is a floating point type and it is very likely that telephone numbers will lose digits in the conversion. This is fine for most values with a large number of digits, as the most significant digits are always maintained. Obviously all digits in a telephone number are equally significant so this should not be considered an acceptable approach.

Importing from Excel is always likely to cause problems as MS, in their wisdom, have designed things such that they know best how you want to import all the Excel data and provide minimal flexibility and control. This is a problem in the design, but not anything that's likely to change any time soon, so you need to find reliable ways around this. This generally means manipulating the data before it's (re)saved in the spreadsheet in the first place.

The most obvious way to do this I suppose, is to format the telephone numbers as they are normally formatted for display anyway. This ensures Excel sees them as string values, which ensures SQL Server will see them as string values.
Aug 29 '11 #2
ck9663
2,878 Recognized Expert Specialist
Or save the excel as txt file then import that text file instead ...

Good Luck!!!


~~ CK
Aug 29 '11 #3
NeoPa
32,557 Recognized Expert Moderator MVP
Good thinking CK, but the reason I didn't include that as an option is that exporting from Excel to text suffers from the same problem. Some may find manipulating the text file easier than managing the worksheet to return the correct values, in which case that may be appropriate for them, but essentially the same job is being done in a text editor that you would otherwise need to do in Excel. One step seems the more straightforward, but take two if you're more comfortable doing the work outside of excel.
Aug 29 '11 #4
ck9663
2,878 Recognized Expert Specialist
True.

I think Microsoft is putting Excel some kind of super light version of SQL Server. Just speaking plainly of tables and database and how you can relate them. Enough to be able to process a lot of rows and tables, but not quite enough that you can do a lot. As if you can use Excel and do not need SQL Server, but not really....

It's their way of saying you still need to use all their products :)


~~ CK
Aug 29 '11 #5
NeoPa
32,557 Recognized Expert Moderator MVP
There's truth in that CK, though Excel does act as more than simply a baby database app. Excel provides many pretty neat features that are outside the scope of databases completely, but there is certainly some limited capability in there for data handling. I doubt many serious database developers would want to design any such thing around a spreadsheet though. We have too many examples of recovering such projects designed by others I would guess ;-)
Aug 29 '11 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
8044
by: Skeleton Man | last post by:
Hi, I have a script that generates numbers beyond the range of it, and so it's throwing them out as scientfic notation (e.g. 5E+10 instead of 50,000,000,000). The only way I've found of...
1
2021
by: masoud bayan | last post by:
I have some values in type of double such 0.00009 , 0.0000007, when I want to show them in a text box and convert them to string they are changed to scientific notation while I want to show them as...
2
5180
by: mo | last post by:
Hi We've got some numbers stored as Reals which are returning values in scientific notation that we need rounded down to 3 digits to the right of the decimal. ie 8.7499999E-2 needs to return...
1
8803
by: Nick | last post by:
Well, the project I am working on has now come to a screeching halt! I have been developing a program that heavily utilizes ADO.NET record sets. To generate reports, I convert the recordset to XML,...
0
1677
by: Greg | last post by:
I am working on an application that requires working with numbers in scientific notation. I am using SqlServer as the database and I have created strongly typed data adapters and datasets. The...
7
10883
by: Dustan | last post by:
How can I get a number into scientific notation? I have a preference for the format '1 E 50' (as an example), but if it's well known, it works.
2
7243
by: Ryan Liu | last post by:
In C#, for a large float (9 digitals), how can I disable Scientific notation. When it auto convert to Scientific notation, I lost accuracy. Thanks a lot! Ryan
9
6611
by: Joe Attardi | last post by:
Hi all, Math is not my strongest area so forgive me if I use some of the wrong terminology. It seems that scientific notation is immune to rounding errors. For example: (4.98 * 100) + 5.51 ...
2
2749
by: rSmoke | last post by:
I have a DataSet that contains a table with about 6 columns of high accuracy decimal values. When I try to write out the DataSet using the WriteXML() function the XML is written fine, but the...
2
6989
by: Greg | last post by:
I am working on an application that requires working with numbers in scientific notation. I am using SqlServer as the database and I have created strongly typed data adapters and datasets. The...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7321
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7377
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7488
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1544
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
412
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.