this code works if there are fields present for both @bill_add1 and @bill_add2 in the database i.e none of them are NULL.
But if either of them r NULL, this code doesn't work.
How can i modify such that even there are null values for either field there should still be an output?
Just know that data manipulation with a value that is potentially null might result in unexpected behavior.
Check out bol when in doubt. The following is an excerpt from "string concatention":
When you concatenate null values, either the concat null yields null setting of sp_dboption or SET CONCAT_NULL_YIELDS_NULL determines the behavior when one expression is NULL. With either concat null yields null or SET CONCAT_NULL_YIELDS_NULL enabled ON, 'string' + NULL returns NULL. If either concat null yields null or SET CONCAT_NULL_YIELDS_NULL is disabled, the result is 'string'.