New Feature Request

Refactors and formats SQL code.

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

New Feature Request

Postby bcunnin » Thu Dec 02, 2010 8:34 pm

I have used SQL Refactor for a while now and really appreciate the features that make it easier to understand existing code, which is what I use it for the most. However, I would like to propose a new feature. I would really like to see a tool in SQL Refactor to remove all unnecessary table aliases. By unnecessary I mean any alias in a query where the table that is aliased only appears once. If the table is joined in twice, like for a self-join, then just leave those alias(s) alone, but remove any other aliases that may appear in the query and replace the alias names with qualified names.

The reason that I’m interested in this feature is two-fold. One, when learning a new schema, I think that it is enough to have to learn one name for each table. To have to learn two names for a table ought to be unnecessary. Secondly, I have run into something I never thought I would see: a stored procedure where the same table in different queries in the procedure are aliased to different values. For example, in one query in the stored procedure the table ‘KpiValue’ is aliased to ‘v’ and in the next query in the same procedure it is aliased to ‘kv’. Yuck.

It seems to me that SQL Refactor probably already has a lot of the stuff in it that this feature would need, so I hope that it wouldn’t be too difficult of a feature to add. Thank you for your time.
bcunnin
 
Posts: 2
Joined: Wed Aug 27, 2008 6:31 pm
Location: Oklahoma

Postby Linda Hawksworth » Mon Dec 06, 2010 1:24 pm

Many thanks for your suggestion. I have logged it in our tracking system with reference SP-3639 (logged against SQL Prompt 5 as SQL Prompt and SQL Refactor are being merged into SQL Prompt v5.).
Linda Hawksworth
 
Posts: 192
Joined: Mon Jun 25, 2007 11:32 am


Return to SQL Refactor 1

Who is online

Users browsing this forum: No registered users and 0 guests