Solved

sql number conversion

Posted on 2011-03-14
1
303 Views
Last Modified: 2012-05-11
UPDATE db_table123
SET [longNumber] = CAST([original_longNumber] as nvarchar(13))

when I copy the original column across I get for example:

153881579694 --> 1.53882e+011
0
Comment
Question by:amillyard
1 Comment
 
LVL 51

Accepted Solution

by:
HainKurt earned 500 total points
ID: 35132716
because it is not a long integer, it is float

try casting to bigint first

UPDATE db_table123
SET [longNumber] = CAST(cast([original_longNumber] as bigint) as nvarchar(13))
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

     When we have to pass multiple rows of data to SQL Server, the developers either have to send one row at a time or come up with other workarounds to meet requirements like using XML to pass data, which is complex and tedious to use. There is a …
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

757 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

20 Experts available now in Live!

Get 1:1 Help Now