I have a database where all of the tables are prefixed with a set of the same characters. This was done because at one time they were in a shared database set up for pet projects with hundreds of other tables. The application, and thus the database, is now ready to be moved out of that phase and ready to be out on it’s own. I would like to remove the prefix for each of the tables. Is there an easier way to do this rather than right-clicking and renaming each table individually?
Share
You could do something like script the whole database and do string replacement on the script, run it on a new database, and then import the data. This of course depends on how well you can match the string to be replaced. You might have to make corresponding changes in your application too. You could always try something like this on a test database to see if it would work.
Take a look at this too – Mass Renaming of Tables and Stored Procedures
One method has some cost and the other is similar to my suggestion.