That's Because while Declaring the Variable @Value u used Decimal data type, u haven't specified the precision and scale.. so it will consider the default Precision and Scale..
Default Precision is 18 and Scale is 0
Declare @Value decimal
in that case
DECLARE @value DECIMAL
SET @value = 11.49
Select @Value as Value,ceiling(@value) as CeilingValue,Floor(@Value) as FloorValue
The Output will be:
Value CeilingValue FloorValue
11 11 11
Where as if u specify the precision and scale then it will be:
DECLARE @value DECIMAL(10,4)
SET @value = 11.49
Select @Value as Value,ceiling(@value) as CeilingValue,Floor(@Value) as FloorValue
the Output will be:
Value CeilingValue FloorValue
11.4900 12 11
Check this Link:
http://msdn.microsoft.com/en-us/library/ms187746.aspx[
^]