sql - Conversion failed when converting the varchar value '<b>' to data type float -
here, trying display data in bold
, did name
column @ backend
, there isn't issue when applying same salary
it's raising error using conversion functions
. so, looking suggestions or solutions :
the case same data , query different , must go through dynamic query below because it's huge various conditions.
create table #test(name varchar(50), salary float) insert #test values ('a', 1000), ('b', 5000) declare @sql varchar(8000) set @sql = 'select ''<b>'' + name + ''</b>'', ''<b>'' + salary + ''</b>'' #test' exec(@sql)
thank you.
create table #test(name varchar(50), salary int) insert #test values ('a', 1000), ('b', 5000) declare @sql varchar(8000) set @sql = 'select ''<b>'' + name + ''<b>'', ''<b>'' + cast(salary varchar(20)) + ''<b>'' #test' exec(@sql)
Comments
Post a Comment