In sql server, I see a strange behaviour:
When I do
select col1+ ' ' + cast(col2 as varchar(10)) as concat_col
it returns me a column with a value = NULL (not a blank column).
My suspicion is that it is because col2 has a value = NULL (not blank column).
So what is the reason for this behavior? But more importantly, what is the meaning of a column with value = NULL as opposed to a blank column? I do not imagine somebody went in the table and updated all the columns with value = NULL.
NULL means that the field does not have any value. You can use ISNULL function to convert a null value into something that you want.The following will hopefully give you the correct result (will not give null)