Answer: We can control this by setting CONCAT_NULL_YIELDS_NULL on or off.
When it is set to ON, the concatenation will result null and when it is set to OFF, it will result the string.
Setting it ON,
SET CONCAT_NULL_YIELDS_NULL on;
print 'testing' + NULL; --results NULL and prints nothing
Setting it OFF,
SET CONCAT_NULL_YIELDS_NULL off;
print 'testing' + NULL; -- results testing and prints the same
Asked In: Many Interviews |
Alert Moderator