Update yourtable
set Col008 = case when charindex('.',cast(Col008 as varchar)) > 0
then Col008
else '0.' + cast(Col008 as varchar)
end
Trevor
----- Original Message -----
From: Indra Timilsina <mssqldba-ezmlmshield-
x88645132.[Email address protected]
Date: Thursday, March 30, 2006 12:14 pm
Subject: updating records
To: LazyDBA Discussion <[Email address protected]
> How can I update record on the table having following condition.
>
>
>
> Update only record on column say "Col008" which contain number without
> decimal point and put decimal point in front of number and donot
> updatein it contain number with decimal
>
>
>
> Like
>
>
>
>
>
> Col008 has following values:
>
>
>
> 34
>
> 2.65
>
> 8.11
>
> 65
>
> 14
>
> 7.32
>
> 65
>
>
>
> It should update to
>
> 0.34
>
> 2.65
>
> 8.11
>
> 0.65
>
> 0.14
>
> 7.32
>
> 0.65
>
>
>
> If any one has information, please let me know.
>
>
>
> Thanks.
>
>
>
>
>
>
>
>
>
> -------------------------------------------------------------------
> --
> TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
> Website : http://www.LazyDBA.com
> To unsubscribe: http://www.lazydba.com/unsubscribe.html
>
MS Sql Server LazyDBA home page