First of all, I would like to know how CAST works with NULL fields and how it behaves when NULL ?
For example, in the expression:
(CAST(INT_FIELD as nvarchar(100))
What happens if INT_FIELD is NULL ?
The reason is that when I try to do the following:
SELECT (CAST(INT_FIELD as nvarchar(100)) + ' ' + SOME_OTHER_FIELD FROM SOME_TABLE;
I get NULL , although SOME_OTHER_FIELD not null. I assume it has some kind of logic, but NULL + something = NULL , but I'm not sure.
How can I control this behavior?
null sql sql-server
Theboyan
source share