Returns the sign (1 for positive, 0, or -1 for negative) of the specified value.
sign(numeric)
is any exact numeric (numeric, dec, decimal, tinyint, smallint, int, or bigint), approximate numeric (float, real, or double precision), or money column, variable, constant expression, or a combination of these.
select sign(-123)
----------- -1
select sign(0)
----------- 0
select sign(123)
----------- 1
sign, a mathematical function, returns the positive (1), zero (0), or negative (-1).
Results are of the same type, and have the same precision and scale, as the numeric expression.
ANSI SQL – Compliance level: Transact-SQL extension.
Any user can execute sign.
For general information about mathematical functions, see “Mathematical functions”.