Why does smart rename of table not rename triggers, constraints, or in comments & descriptions?
roryap
Posts: 1 New member
in SQL Prompt
I am using smart rename to rename a table, but I'm surprised that it doesn't offer to rename things like constraints and triggers (which contain the table name) or any usages of the table name within comments or at least object description fields. Am I missing a setting somewhere?
Answers
Good Afternoon!
Regarding your query, I'm afraid that Smart Rename will only rename tables, views, stored procedures, and functions. It's not possible to have it rename triggers or constraints, I'm very sorry to say.
Can you please add a request for this on our UserForum here: https://redgate.uservoice.com/forums/94413-sql-prompt?
In case you're interested in trying this though, one of my colleagues has previously suggested the following alternative to Smart Rename to help with renaming everything:
"An approach I'd be tempted to try is to use SQL Compare to create a scripts folder of your database and then use some form of regular expression searching to change names as needed (I know Notepad++ will let you do a regular expression search and replace on the contents of a folder). Once you've modified the scripts, you could use SQL Compare to compare the scripts folder to the original database and then deploy them back to your database. It's a bit tricky but I think it's possible."
I hope that may help!
Sean Quigley | Product Support Engineer | Redgate Software
Have you visited our Help Center?