Tutorial :SQL Server adding values



Question:

SELECT @s = ISNULL(@s + '. ' , '') + [Comments] FROM [Customer]

RETURN @s     

How can I catch Null or '', so that if its either It Won't append to the string and not add a '.'

Thanks

Jacob


Solution:1

SELECT      @s = ISNULL(NULLIF(@s, '') + '.', '') + comments  FROM      [Customers]    RETURN @s  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »