Archive

Archive for the ‘Operators’ Category

Compound Operators in SQL Server

June 30th, 2011 admin No comments

There was a time when we all wished SQL Server supports compound operators just like any other programming languages. Wouldn’t it be nice to have a shorter syntax for assigning the result of an arithmetic operator?  Well, SQL server 2008 introduced Compound operators that allow you to perform several arithmetic operations using an operand along with equal to (=) operand.

 For example:

Declare @var1  int

Set @var1 = 150

Set @var1 += 100

Read more…

Understanding logical operators ( And / Or / Not ) in SQL Server

November 14th, 2010 admin No comments

Logical operators can be used in the queries to retrieve records based on one more conditions. In a select statement, the conditions specified by the logical operators are connected using a WHERE clause.

General syntax :

Select ColumnList

From TableName

Where ConditionalExpr1 {AND/OR} [NOT]   ConditionalExpr2

There are 3 types of logical operators

Read more…