120
SQL Server IS NOT NULL Condition (Operator)
SQL Server IS NOT NULL condition is used to test for a NOT NULL value.
Syntax:
Parameter explanation
expression: It specifies the value to test where it is NOT NULL value.
Note: If the expression is NOT a NULL value, the condition evaluates to TRUE. If it is a NULL value, the condition evaluates to FALSE.
IS NOT NULL operator with SELECT Statement
Example:
Retrieve all employees from the table “Employees” where salary is NOT NULL value.
Output:
IS NOT NULL operator with INSERT Statement
Example:
Output:
IS NOT NULL operator with UPDATE Statement
Update the employees of “Employees” table and set the name “Active” where name is not null.
Example:
Output:
Verify the example:
IS NOT NULL operator with DELETE Statement
Update the employees of “Employees” table where name is not null.
Output:
Verify the example:
You can see that all employees are deleted from the table “Employees” where name is NOT NULL.
Next TopicLIKE Operator