cross database usage of Smart Rename

Refactors and formats SQL code.

Moderators: Chris Auckland, David Atkinson, Anu Deshpande, Luke Jefferson

cross database usage of Smart Rename

Postby JoshuaQSP » Mon Jun 01, 2009 8:51 pm

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
JoshuaQSP
 
Posts: 2
Joined: Mon Jun 01, 2009 8:28 pm

Postby Anu Deshpande » Tue Jun 02, 2009 1:52 pm

Thank you for your post into the forum and sorry that you have encountered this problem.

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.
Anuradha Deshpande
Product Support
Redgate Software Ltd.
E-mail: support@red-gate.com
Anu Deshpande
 
Posts: 692
Joined: Mon Apr 20, 2009 3:53 pm
Location: Cambridge

re: cross database usage of Smart Rename

Postby JoshuaQSP » Tue Jun 02, 2009 9:04 pm

Hi Anu. Thank you for your reply.

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
JoshuaQSP
 
Posts: 2
Joined: Mon Jun 01, 2009 8:28 pm

Postby Anu Deshpande » Wed Jun 03, 2009 10:54 am

Hi 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!
Anuradha Deshpande
Product Support
Redgate Software Ltd.
E-mail: support@red-gate.com
Anu Deshpande
 
Posts: 692
Joined: Mon Apr 20, 2009 3:53 pm
Location: Cambridge

Postby Anu Deshpande » Wed Jun 03, 2009 11:49 am

Hi Joshua

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.
Anuradha Deshpande
Product Support
Redgate Software Ltd.
E-mail: support@red-gate.com
Anu Deshpande
 
Posts: 692
Joined: Mon Apr 20, 2009 3:53 pm
Location: Cambridge

Postby swirl80 » Wed Jun 17, 2009 1:41 pm

can i piggy back this thread for a moment as i have a similar question.

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
swirl80
 
Posts: 21
Joined: Thu Oct 23, 2008 4:26 pm

Postby Anu Deshpande » Wed Jun 17, 2009 1:50 pm

Thanks for your post.

We will definitely make a note of it.

Thanks for your suggestion.
Anuradha Deshpande
Product Support
Redgate Software Ltd.
E-mail: support@red-gate.com
Anu Deshpande
 
Posts: 692
Joined: Mon Apr 20, 2009 3:53 pm
Location: Cambridge


Return to SQL Refactor 1

Who is online

Users browsing this forum: No registered users and 0 guests