Operators

Operators are symbols that indicate that a specific action is to take place with one or more expressions. A great number of operators are available in SQL Server. Operators are divided into several categories, based on the operations they perform:

  • Assignment

  • Arithmetic

  • Comparison

  • Logical

  • String concatenation

  • Bitwise

  • Unary

Assignment Operator

This operator—the equal sign (=)—is one of the most ubiquitous operators that you will run into. The assignment operator assigns a value to a variable or a column. An example of this is as follows:

SELECT @intValue = 1

Arithmetic Operators

Arithmetic operators are the same simple operations that you learned in grade school to add, subtract, multiple and divide numbers. These operators are used ...

Get Writing Stored Procedures for Microsoft SQL Server 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.