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 |
ranjeetsingh_6
Posting Yak Master
125 Posts |
Posted - 2006-08-11 : 03:32:01
|
Hi I have a Table and this table contain a column flttotal_Amountthis column Datatype is Float.I use this table for insert value.I Want when i will insert any integer valu in this column it should be inserted as its Float value Means when i insert into this value12 then 12.00 should inserted.I Want ThisI am inserting Value in my Tables's Column By this Queryinsert into tblamount values(12)and I want The value store in DataBase 12.00 If Function ,store procedure or trigger will use then send code PlzRanjeet Kumar Singh |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-08-11 : 03:35:21
|
Did you try this ?insert into tblamount (flttotal_Amount) values(12) KH |
|
|
ranjeetsingh_6
Posting Yak Master
125 Posts |
Posted - 2006-08-11 : 04:02:37
|
yes i am using thisinsert into tblamount (flttotal_Amount) values(12) my main prob is i am inserting integer value and want to store as a float. table column's datatype is float.Ranjeet Kumar Singh |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-08-11 : 04:04:32
|
did you try select * from tblamount ?as the data type is float, the data will be stored as floating point value. KH |
|
|
ranjeetsingh_6
Posting Yak Master
125 Posts |
Posted - 2006-08-11 : 04:25:55
|
yes I have use select * from tblamount and Find OUTPUT 12But i want this output 12.00Value inserted correctlly But output comes accordig to input value when i want always float value For Example:if i insert in table vales 212,23,23,12then Output 212.00,23.00,12.00Ranjeet Kumar Singh |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-08-11 : 04:34:47
|
[code]create table #tblamount( flttotal_amount float)insert into #tblamount select 212insert into #tblamount select 23insert into #tblamount select 23insert into #tblamount select 12select * from #tblamount/*flttotal_amount ---------------212.023.023.012.0(4 row(s) affected)*/drop table #tblamount[/code] KH |
|
|
ranjeetsingh_6
Posting Yak Master
125 Posts |
Posted - 2006-08-11 : 04:57:05
|
Thanks Problem have solvedRanjeet Kumar Singh |
|
|
|
|
|
|
|