I have a set of databases and each of them contains a table named 'data'. I would like to add a new column to the table 'data' in all databases. Is it possible to do this with a sql statement? And would it work on MySQL 3.x server?
+1
A:
As far as I know you must do an "Alter Table" on every table of every database.
Carsten
2009-02-23 15:51:04
A:
Excuse me for my lack of knowledge in sql, but how could I just iterate the whole set of databases and add a column to every table named 'data'? Thanks in advance
You can't do it in SQL as such, you'd have to do it in a procedural language that builds and makes the ALTER TABLE call.
staticsan
2009-02-24 06:15:15