A developer came to me with a problem regarding using POWER() function in his stored procedure. The result always comes out with the last 3 digits always cut off. His data type was decimal (30,10).
From MSDN, http://msdn.microsoft.com/en-us/library/ms174276(v=sql.105).aspx, the data type that use as paramater will the datatype of the result.
From experience, what worked for me and i recommended this to our dev team, was to use float datatype as is, float.
Running the below will give you 2 different results.
declare @x as float = 0.8529703299
select power(@x, 2) as ‘Result’
declare @y as decimal(30,10) = ‘0.8529703299’
select power(@y, 2) as ‘Result’
So the float_expression should be just that, float datatype. I hope this helps someone out there too!
Enjoy the new work week!