tags:

views:

93

answers:

2

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
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