I want to ask if anybody know the query to drop the 0 value in decimal..
E.g : A field name percent have these values
770.00000000000000000000,
This rather nasty TSQL might just do the job :
select
case
right(
cast(cast([percent] as decimal(9,2)) as nvarchar(11))
,2)
when '00' then cast(cast([percent] as int) as nvarchar(11)) as [percent]
else cast(cast([percent] as decimal(9,2)) as nvarchar(11)) as [percent]
end
from table
of course it is always returning a string, but that's inherent to your demands, you are looking for a representation for a value...
I think you should postpone that representation to where it makes more sense (report, datagrid?) and you have more tools (like string.format kinda tools) to do the job better.