Last active
March 1, 2017 17:50
-
-
Save todgru/17aa3fc93e892562d7cf42d2e7a82f6e to your computer and use it in GitHub Desktop.
Query that writes an alter table query for all tables of a certain name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT concat( 'ALTER TABLE ', a.table_name, ' MODIFY field_name VARCHAR(255) NOT NULL;' ) | |
FROM information_schema.tables a | |
WHERE a.table_name LIKE 'foo%bar'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment