2.3. EXPRESSIONS IN AN SQL STATEMENT

An expression is a combination of operands and operators, which evaluates to a scalar:

  • Scalar: a single data value such as number 13, date '1 Jan 2003' or string 'Jim Doe'

  • Operand: a constant (literal), column name, variable, scalar function subquery whose result set is a scalar value

  • Operator: any legal operator symbol allowed by the data type of the operand(s)

An expression generally assumes the data type of its component operands except that operands combined using comparison or logical operators result in a value of Boolean data type.

String, numeric and date expressions may usually be used anywhere a scalar value of their data type is required in INSERT, UPDATE, DELETE and SELECT statements. (See the ...

Get Transact-SQL Desk Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.