Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Collapse the table of content
Expand the table of content
Expand Minimize

SIGN (SQL Server Compact)

Returns the positive (+1), zero (0), or negative (-1) sign of the given expression.

SIGN ( numeric_expression ) 


An expression of the exact numeric or approximate numeric data type categories, or types that are implicitly convertible to float (except for the bit data type).

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

Specified expression Return type

tinyint, smallint




Nonnumeric types that can be implicitly converted to float


The following example returns the SIGN of the difference between the units of products in stock and units of products that have been ordered in the Products table.

SELECT ([Units In Stock] - [Units On Order]), SIGN([Units In Stock] - [Units On Order])
FROM Products
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft