From: Greg Berthume on
Table: CostCenter
Column: CostCenterName

I want to remove all ':' from CostCenterName (update data in table).

How do I do this in T-SQL ?

Thanks,
Greg


From: Bob Barrows on
Greg Berthume wrote:
> Table: CostCenter
> Column: CostCenterName
>
> I want to remove all ':' from CostCenterName (update data in table).
>
> How do I do this in T-SQL ?
>
> Thanks,
> Greg
Use the REPLACE function to replace them with empty strings:

update costcenter
set costcentername=REPLACE(costcentername,':','')
where costcentername like '%:%'

--
Bob Barrows


From: Greg Berthume on
Thanks! Worked perfectly.

"Bob Barrows" <reb01501(a)yahoo.com> wrote in message
news:Wh7Vn.2218$sR2.768(a)newsfe24.iad...
> Greg Berthume wrote:
>> Table: CostCenter
>> Column: CostCenterName
>>
>> I want to remove all ':' from CostCenterName (update data in table).
>>
>> How do I do this in T-SQL ?
>>
>> Thanks,
>> Greg
> Use the REPLACE function to replace them with empty strings:
>
> update costcenter
> set costcentername=REPLACE(costcentername,':','')
> where costcentername like '%:%'
>
> --
> Bob Barrows
>