Compound Operators in SQL Server

Compound Assignment Operators in SQL Server 2008 

Compound assignment operator means an operator combined with another operator. We have used such assignment operators in C++ and C#. This Compound Assignment Operator is introduced in SQL Server 2008.

 

The compound assignment operators; supported in SQL Server 2008 are:

 

Compound Assignment

Operator

Description
+= Add and assign
-= Subtract and assign
*= Multiply and assign
/= Divide and assign
%= Modulus and assign
&= Bitwise AND and assign
|= Bitwise OR and assign
^= Bitwise XOR and assign

 

Compound Assignment Operator - Add and Assign Example:

 

Declare @Compvar int
Set @Compvar = 3
--using Compound assignment operator
Set @Compvar+=7
Select @ Compvar as CompResult
Go

Output will be

MyResult
10
(1 row(s) affected)

In the above example, the compound assignment operator added the value 7 to the existing value of the variable @Compvar and assigned the resulting value to @Compvar.

Comments

# Compound Operators in SQL Server Compound assignment operator means an operator combined with another operator. We have used such assignment operators in C++ and C#. This Compound Assignment Operator is introduced in SQL Server 2008. « KaushaL.NE

Pingback from  Compound Operators in SQL Server Compound assignment operator means an operator combined with another operator. We have used such assignment operators in C++ and C#. This Compound Assignment Operator is introduced in SQL Server 2008. « KaushaL.NET

# re: Compound Operators in SQL Server

Friday, August 21, 2009 10:49 PM by spoidseviff

Need more info about Shopping center malls? You are welcome! http://center.goodnano-av.com/

# re: Compound Operators in SQL Server

Sunday, August 23, 2009 9:55 AM by spoidseviff

Need more info about Shopping center malls? You are welcome! http://center.goodnano-av.com/

# re: Compound Operators in SQL Server

Sunday, August 30, 2009 6:35 AM by Stoleasse

Questions and answers about 1973 oldsmobile 442 and Intrigue oldsmobile recall.

# re: Compound Operators in SQL Server

Thursday, September 10, 2009 10:46 AM by Dopynaccara

Adidas soccer boots and Tecnica moon boots, Kids rubber boots and Frey boots here clothes.goodnano-av.com

# re: Compound Operators in SQL Server

Wednesday, September 16, 2009 9:55 PM by Mybrigmekeerb

Computer brands and What are computer virus, New computer softwares and Background computer here computers.goodnano-av.com

# re: Compound Operators in SQL Server

Friday, September 18, 2009 5:58 PM by effidepelmimb

est reviews of the day about Brazil, Brazil vacation, Brazil cheap flight and Brazil news here countries.goodnano-av.com

# re: Compound Operators in SQL Server

Tuesday, October 06, 2009 6:21 AM by apedIrriggize

Tired of searching for ***? This way! http://***.goodnano-av.com/

# re: Compound Operators in SQL Server

Friday, October 23, 2009 9:45 AM by FiendyDypeDes

Best choice of the week about Ebony, Ebony tailpiece, Ebony veneers and Ebony hairstyles. http://ebony.goodnano-av.com/

# re: Compound Operators in SQL Server

Friday, October 30, 2009 11:04 AM by Offerieunorry

Best reviews of the day: Lexicon, Arabic lexicon, 2 dictionary lexicon quotation shakespeare vol and Greek english lexicon electronics.goodnano-av.com