Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
cable_si
Starting Member
20 Posts |
Posted - 2011-10-31 : 08:37:16
|
Hi I have a table like below, where col1 is a varchar columntable 1col10.040.040.0350.0350.04i want to transfer this information to another table using a select inserteach time i try and do this it automatically rounds up some of the values. i.e 0.035 becomes 0.04 I tried using CONVERT(DECIMAL(10,3),col1) which is ok for those values 0.035 but for the ones which say 0.04 it adds an extra 0 at the end to show 0.040 How can i get it so it inserts the data into a new table without the values in col1 being automatically rounded up or without extra 0's being addedthanksSimon |
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2011-10-31 : 08:55:02
|
What is the datatype for the new table and how are you transferring?Are you sure that the data is being rounded on insert rather than display?==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
cable_si
Starting Member
20 Posts |
Posted - 2011-10-31 : 09:00:25
|
The datatype in both tables is a varchar(20)data is transfered byinsert new_tableselect col1 from table1 |
 |
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2011-10-31 : 09:37:22
|
Think you should check your testing - I don't see how that can happen.It can only round if it's being converted to a numerid datatype and that statement won't do that.Maybe there is a trigger on the destination table?==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|