[thelist] Find-and-Replace in SQL

Carlos Costa Portela ccosta at servidores.net
Thu Sep 26 15:07:00 CDT 2002


On Thu, 26 Sep 2002, Wade Armstrong wrote:
> I have a client who has changed their company's name. Many moons ago, we
> built these folks a Web site with a content management system using SQL
> Server 7.0 and ASP. Their site has grown to a couple hundred pages, and I'd
> love to be able to just put in some SQL command like "REPLACE 'Old Company
> Name' WITH 'New Company Name' IN table_name" but sadly it seems that REPLACE
> doesn't work that way. Is there a way to do this in straight SQL?

	Try with

	UPDATE table_name SET name='New Company Name' where name='Old
Company Name' ;

	Is there a lot of tuples with 'Old Company Name' ?

	Hope this helps,
		Carlos.

       [ http://www.biologia.org/ :: portal especializado en Biología ]
_______Carlos Costa Portela_________________________________________________
| e-mail:  ccosta at servidores.net | home page: http://casa.ccp.servidores.net |
|_____Tódalas persoas maiores foron nenos antes, pero poucas se lembran______|




More information about the thelist mailing list