Like other .net programming languages compound assignment operators are introduced in SQL Server 2008. If you want to do any basic arithmatic operation (+, -, *, /, %) with any variable and simultaneously assign it to the variable then this proves to be easier in implementation.
DECLARE @MyIntVar INT = 4
SET @myINTVar += 2
SELECT @myINTVar
No comments:
Post a Comment