Export (0) Print
Expand All
ABS
ALL
AND
ANY
AVG
bit
COS
COT
DAY
EXP
GO
IN
LEN
LOG
MAX
MIN
NOT
OR
PI
SET
SIN
STR
SUM
TAN
USE
VAR
Expand Minimize
This topic has not yet been rated - Rate this topic

- (Negative)

SQL Server 2000

Is a unary operator that returns the negative value of a numeric expression (a unary operator).

Syntax

- numeric_expression

Arguments

numeric_expression

Is any valid Microsoft® SQL Server™ expression of any of the data types of the numeric data type category except the datetime or smalldatetime data types.

Result Types

Returns the data type of numeric_expression, except that an unsigned tinyint expression is promoted to a signed smallint result.

Examples
A. Set a variable to a negative value

This example sets a variable to a negative value.

DECLARE @MyNumber decimal(10,2)
@MyNumber = -123.45
B. Negate a value

This example negates a variable.

DECLARE @Num1 int
SET @Num1 = 5
SELECT -@Num1

See Also

Data Types

Expressions

Operators

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.