0

I have more than 300 columns in around 60 tables. Updating each column to a default value of '0' manually makes no sense. Is there a procedure that can change the default value for columns, currently 'NULL', in one table to a default value of '0' for each column in a table? repeating this task 60 times is not such a big deal since it will be done once and for all.

2 Answers 2

1

Since my column titles were programatically generated, I was able to regenerate all the column titles and therefore use that to generate MySQL statements to alter each of the columns.

Sign up to request clarification or add additional context in comments.

Comments

0

This is not a feature of phpMyAdmin.

3 Comments

alright, is it possible with MySQL statements? :) looking for a solution here
The ALTER TABLE statement requires to specify the column so you would have to issue one such statement per column. Unless you can programm atically generate those statements.
good thing I have the columns programmatically generated, so I can regenerate their titles again and with that generate a SQL statement that updates each column. Tried and it worked perfectly

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.