Prev: Replacing multiple statements with a single MERGE
Next: sharing DBs between 2 instances on same box without linked servers
From: Greg Berthume on 25 Jun 2010 15:11 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 25 Jun 2010 15:18 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 25 Jun 2010 15:26
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 > |