Here is one more procedure – (this time) for mass renaming of table. Adding and Removing table-name prefixes
A friend of mine was renaming 100+ tables by using replace methods in notepad.
I showed em a bit better editor: Editplus and then I thought of rescue rest of those who are still interested in some techie-solution to such things.
This procedure is outcome of that try and its as usual very simple one with two functionalities:
- rename mysql table of a database by adding prefix
- rename mysql table of a database by removing prefix
So below mysql stored procedure just not renames to add but also removes prefixes from table names.
Download the Procedure: prefix_all
How to use:
1. Execute / Create Stored procedure by downloading or copy pasting sql script.
2. Execute: call prefix_all(‘DATABASE-NAME’,'PREFIX’,0);
Where 0 will remove the prefix from mysql table name, while 1 will add prefix.
Code:
Related posts:
- Stored procedure – Execute query if table or Column exists Well procedures mainly carried out working with information schema and...
- Stored procedure to Find database objects This procedure lists available database objects under passed database name....
- MySQL Stored procedure to Generate-Extract Insert Statement A lot of places I saw people asking for ways...




[...] Stored procedure to add-remove prefix by rename table mysql … Tags: aids, awareness-programmes, cleveland-cavaliers, hiv, one-more, page-contains, renaming-100, [...]
really good example