Wednesday 17 October 2012

ASSIGNMENT OPERATOR





Equal sign (=) is the assignment operator.

Example:
DECLARE @Initial_Value INT;
SET @Initial_Value = 2;
SELECT @Initial_Valuel;

            In the above example, a variable @Initial_Value is created. The variable type is integer (Declare @Initial_Value int), and then assigned a value to the variable (Set @Initial_Value=2). Extracting the variable value using “Select @Initial_Value” command.

Result: 2


No comments:

Post a Comment