cross database usage of Smart Rename
JoshuaQSP
Posts: 3
I ran a test and noticed that when I used the Smart Rename feature on a table's column name, it only updated stored procedure code that referenced the column in question, if that sp is in the same database. If the sp code resides in another db, it is not updated, even though it references the column being renamed.
I have a "common" database with tables like account, user, customer, season, etc, that are then referenced across all of the other sql dbs on the server. Is there a way to get smart rename to rename a column and include referencing stored procedures from multiple dbs ? A setting to change etc? If not, is this feature in a future versions wish list ?
Our current work around is to run dependency tracker as well (for the table), find all of the hits, comb through them to find dependency hits on that specific column, then hand-edit the code. Its time consuming and not pretty.
thanks,
Joshua
I have a "common" database with tables like account, user, customer, season, etc, that are then referenced across all of the other sql dbs on the server. Is there a way to get smart rename to rename a column and include referencing stored procedures from multiple dbs ? A setting to change etc? If not, is this feature in a future versions wish list ?
Our current work around is to run dependency tracker as well (for the table), find all of the hits, comb through them to find dependency hits on that specific column, then hand-edit the code. Its time consuming and not pretty.
thanks,
Joshua
Comments
I have tested as per your example and replicated your problem.
I have created a Bug Report for the development team to consider. The reference for the Bug Report is SR-843. Hopefully the development team will rectify this bug in a future version of SQL Refactor.
Product Support
Redgate Software Ltd.
E-mail: support@red-gate.com
Is there another work around that you can suggest that may work better then the method we are currently using ?
Is there a way to recieves updates on bug SR-843 (email subscription, website to check, etc ?
thanks,
Joshua
Thanks for the update.
I am afraid I have no intelligent work around for you at the moment but I recreated your issue and can suggest a way using dependency tracker.
Following are the steps (for example let us consider you need to change table T1 in database D1 and you are referring that in stored procedure S2 in database D2):
1. Change the name of T1 in D1 and run the script provided by SQL Refactor to reflect changes in D1 as it will not do any changes in D2.
2. Start Redgate Dependency Tracker.
3. Add the table from D1 which you chnaged and add all Stored procedures in D2.
4. Dependency tracker will highlight for you 'Unresolved Internal Reference- Object not found'
This should make your life more easier.
Note: To make dependency tracker to highlight the missing object you need to add both the databases in the project.
Kindly let us know if that was useful and also if you have any other question,I'll like to help!
Product Support
Redgate Software Ltd.
E-mail: support@red-gate.com
I am sorry I forgot to mention about the bug tracking.
SR- 843 is a feature added in our internal system and there is no way of tracking it externally I am afraid!
But what I did is I have added a watch on feature request submitted and can update you on the progress of the same.
Hope that is fine with you.
Product Support
Redgate Software Ltd.
E-mail: support@red-gate.com
Will smart rename ever provide the facility to rename an object in order to move it to another schema in another database? At present you can only amend objects within the same database.
thanks
We will definitely make a note of it.
Thanks for your suggestion.
Product Support
Redgate Software Ltd.
E-mail: support@red-gate.com