Export (0) Print
Expand All


SQL Server 2000

Returns the smallest integer that is greater than, or equal to, the given numeric expression.

CEILING ( numeric_expression ) 
Is an expression of the exact numeric or approximate numeric data type categories, or types that is implicitly convertible to float (except for the bit data type).
Return Types

Returns the same type as numeric_expression except for the following expressions.

Specified expression Return type
tinyint, smallint int
real/float float
Nonnumeric types that can be implicitly converted to float float

This example uses the CEILING function to round off the unit price for products in the Northwind database that are priced more than 100 dollars.

SELECT OrderID, UnitPrice, CEILING (UnitPrice) AS "CEILING"
FROM "Order Details"
WHERE UnitPrice > 100
ORDER BY UnitPrice
© 2014 Microsoft