Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Update only part of a record

Author  Topic 

qman
Constraint Violating Yak Guru

442 Posts

Posted - 2007-08-10 : 09:06:36
Let's say I am interested in updating the company_name column within our company table.
Everywhere someone entered 'ABC Ins. Co.', I want to replace 'Ins. Co.' with 'Insurance Company'.....

I am not too familiar with updating part of a record. I do not know if substring will work with this since each company has a different name.

Any help would be much appreciated.

Thanks
qman

ditch
Master Smack Fu Yak Hacker

1466 Posts

Posted - 2007-08-10 : 09:10:55
replace(company_name, 'ins. co.', 'insurance company')

Duane.
Go to Top of Page

qman
Constraint Violating Yak Guru

442 Posts

Posted - 2007-08-10 : 10:05:13
Thanks Duane, you rock!
Go to Top of Page
   

- Advertisement -