Standardized Table Aliases

Unless I’m mistaken, the current version of Toad (including 6.0 beta) doesn’t support the following and I’d really like it added.

Consider the following:

Select EmployeeFirstName, EmployeeLastName From DimEmployee

  1. I’d like the ability to automatically alias the table. For example, DimEmployee could become DE. Another competing product already offers this:
    http://www.red-gate.com/supportcenter/content/SQL_Prompt/help/5.3/SPT_Aliases

  2. Suppose I choose to now add one or change an existing alias that I don’t like.
    Select EmployeeFirstName, EmployeeLastName From DimEmployee as DE
    Why can’t Toad go back through my query and properly update the query to add “DE.” in front of the selected items from that table?

These are pet peeves of mine which cost me time every single day.

  1. This goes along with the previous requests, but now let’s add a joined table to it. If I allow the auto-complete to pull in the FK relationship I get the following:
    Select DE.EmployeeFirstName, DE.EmployeeLastName From DimEmployee as DE
    join dbo.FactOrders ON dbo.FactOrders.SalesRepKey = DE.EmployeeKey

Now I have to manually alias dbo.FactOrders as FO and fix the ON clause.

There’s got to be a better way to handle this.

Dear DavidStein,

very nice idea.

I vote for it.

I have similar problem when I wrote select with join on tables.

Best regards.

Sergio Bertolotti

Totally agree with you, guys.
I’ve created CR107220 and 107222 to improve code completion.

thanks for the post.

Dear Alexander,

good news.

Many thank’s for your help and support.

Best regards.
Sergio Bertolotti

Sergio, David,
As a continuation for the 2nd and 3rd requests - are there any difficulties that prevent you from using Find&Replace? I just realised that it is really fast and easy to use in this scenario. What do you think?

Alexander,

for me it’s OK your solutions.

The only my request is have the possibility to use aliases on tables, expecially when generate join of two or more tables, the aliases must be inlcuded in the syntax. Like in 1) request.
In this mode the T-SQL code became more readable.

If I must change the syntax of sql statements like 2) or 3) I can do it with your find and replace feature, wihtout problems and after save the new T-SQL statement.

Case 2) or 3) it’s more an automatically re-engeenering of T-SQL code. I don’t think that points 2) or 3) aren’t important but for me case 1) is more useful.

Best regards.

Sergio Bertolotti

Sergio,
thank you for your feedback. 1st request is valid and we put it on schedule. But 2nd and 3rd are definitely more complicated. Especially taking into account available workflow.
Please note, we redesigned Find&Replace dialog and now it can operate with selected region only, that is perfectly suits to this scenario.

Alexander,

nothing for the feedback. It’s a pleasure…

When will be available new version of redesign Find and Replace feature to work with selected region ?
In TOAD SS 6 or 6.x ?

Best regards.
Sergio Bertolotti

It is already in your Beta build :wink: Just hit Ctrl+F in nonempty Editor.

Alexander,
excuse me for the misunderstanding I see and use it sometime.
Very good feature.

Best regards.

Sergio Bertolotti

Alexander, I apologize for abandoning this thread. Has these auto aliasing change requests been implemented?

Is there a way for me to be able to track that myself?

David,
it is ok. Both CRs are deferred to the next release b/c it is not so easy to do and we were not able to complete it in this release.

We do not have a way to track CRs from outside the company unfortunately. The reason why we leave CR numbers just for the reference convenience.

Alexander,

there is some news about this request ?

I’m very interesting to implementation of point 1), alieases of statement sql…

I stay tune for an answer from some Dell’s developers or support.

Best regards.

Sergio