SQL Flow Field Guide

CEILING

Catalog support for SQL Server 2022 (16.x) and 2025 (17.x)

math

What changes

Input
numeric arguments
Output or change
numeric value
Return type
The return type depends on the input type of numeric_expression: Input type Return type float, real float decimal(p, s) decimal(p, 0) int, smallint, tinyint int bigint bigint money, smallmoney money b

Syntax at a glance

CEILING ( numeric_expression )

Work example

Round a positive quantity up to a whole unit such as a box count.

Check negative values because ceiling moves toward the next greater integer.

Check your work CEILING returns the smallest integer greater than or equal to its input, using a type-specific result.

Practice SQL

Open in SQL Flow
SELECT CEILING(CAST(2.1 AS decimal(5,2))) AS whole_units;

Open Microsoft Learn for full syntax, permissions, and details for your version.