I have table with real column, i need to multiple all row with billion , this give me good result(151112000):
declare @tbl table (n real)
insert into @tbl values(151.112)
select cast (n * 1000000 as float) AS [Quantity1]
from @tbl
But when i select from old existing table, 151.112
became to 151112048
.
How it can be?
My old ddl table:
CREATE TABLE [dbo].[ProvidentSegmentPortfolioMonthlyHistory](
[Fund_id] [int] NOT NULL,
[Report_Date] [datetime] NOT NULL,
[Segment_id] [int] NOT NULL,
[Quantity] [real] NULL,
[QuantityPercent] [real] NULL,
[Date_Update] [datetime] NULL,
[operator] [varchar](50) NULL,
CONSTRAINT [PK_ProvidentSegmentPortfolioMonthlyHistory ] PRIMARY KEY CLUSTERED
(
[Fund_id] ASC,
[Report_Date] ASC,
[Segment_id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO