Word search/replace on entire DB
I have a DB with 15+ tables in it and I need to replace a brand name (one word no spaces) in all the tables with a different name. Iím a little rough around the edgesí with my SQL statements, any experts out there that can save me a few hours?
For both MySQL and MSSQL, I assume you're looking for something like ...
update tablename set col=replace(col, "old_brand", "new_brand");
TSQL (MS SQL SERVER): http://msdn.microsoft.com/en-US/libr...v=SQL.90).aspx
Is that what you need?
Thats exactly what i need.
for anyone reading this with the same problem, use:
to grab all the columns in your table, then loop through using svidgen's command.
SHOW COLUMNS FROM '.$dbtable
Last edited by apeg; 06-04-2010 at 03:42 PM.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)