Reputation: 16705
I have the following code:
set @mystring = coalesce(numericval,'');
What I want is the following behaviour:
I can't coelesce this to a numeric value, because that value will be output, and I can't convert it while it's null.
How can I achieve this?
Upvotes: 0
Views: 6871
Reputation: 8129
Try this
Declare @mystring as varchar(Max)
set @mystring = coalesce(Cast(numericval as varchar),'');
Select @mystring
Upvotes: 1