I have the following SQL statement:
@All = COALESCE(NULLIF(@Asc1, '') + ',', '') +
OALESCE(NULLIF(@Asc2, '') + ',', '') +
OALESCE(NULLIF(@Asc3, '') + ',', '');
This will insert a comma at the end even if any of the variables (@Asc1, @Asc2, @Asc3) have NULL or empty values.
For example:
- if
@Asc1 = 1234and@Asc2 = 3456and@Asc3 = '', then@Allwill end up being1234,3456,
I would like @All to be 1234,3456
Thanks.