# Standardized Table Aliases

**URL:** <https://forums.toadworld.com/t/standardized-table-aliases/17159>\
**Category:** Toad for SQL Server\
**Created:** [March 5, 2013, 7:38am UTC](https://forums.toadworld.com/t/standardized-table-aliases/17159 "2013-03-05T07:38:24Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![DavidStein](https://avatars.discourse-cdn.com/v4/letter/d/cab0a1/32.png) [@DavidStein](https://forums.toadworld.com/u/DavidStein)\
**Post date:** [March 5, 2013, 7:38am UTC](https://forums.toadworld.com/t/standardized-table-aliases/17159/1 "2013-03-05T07:38:24Z")

</div>

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](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.

---

<div class="post-metadata">

**Author:** ![s.bertolotti](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@s.bertolotti](https://forums.toadworld.com/u/s.bertolotti)\
**Post date:** [March 5, 2013, 8:24am UTC](https://forums.toadworld.com/t/standardized-table-aliases/17159/2 "2013-03-05T08:24:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Alexander.Maximov](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/alexander.maximov/32/114_2.png) [@Alexander.Maximov](https://forums.toadworld.com/u/Alexander.Maximov)\
**Post date:** [March 6, 2013, 9:16am UTC](https://forums.toadworld.com/t/standardized-table-aliases/17159/3 "2013-03-06T09:16:21Z")

</div>

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

thanks for the post.

---

<div class="post-metadata">

**Author:** ![s.bertolotti](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@s.bertolotti](https://forums.toadworld.com/u/s.bertolotti)\
**Post date:** [March 6, 2013, 9:43am UTC](https://forums.toadworld.com/t/standardized-table-aliases/17159/4 "2013-03-06T09:43:19Z")

</div>

Dear Alexander,

good news.

Many thank’s for your help and support.

Best regards.  
Sergio Bertolotti

---

<div class="post-metadata">

**Author:** ![Alexander.Maximov](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/alexander.maximov/32/114_2.png) [@Alexander.Maximov](https://forums.toadworld.com/u/Alexander.Maximov)\
**Post date:** [March 11, 2013, 5:15am UTC](https://forums.toadworld.com/t/standardized-table-aliases/17159/5 "2013-03-11T05:15:12Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![s.bertolotti](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@s.bertolotti](https://forums.toadworld.com/u/s.bertolotti)\
**Post date:** [March 12, 2013, 9:03am UTC](https://forums.toadworld.com/t/standardized-table-aliases/17159/6 "2013-03-12T09:03:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Alexander.Maximov](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/alexander.maximov/32/114_2.png) [@Alexander.Maximov](https://forums.toadworld.com/u/Alexander.Maximov)\
**Post date:** [March 12, 2013, 9:39am UTC](https://forums.toadworld.com/t/standardized-table-aliases/17159/7 "2013-03-12T09:39:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![s.bertolotti](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@s.bertolotti](https://forums.toadworld.com/u/s.bertolotti)\
**Post date:** [March 12, 2013, 9:49am UTC](https://forums.toadworld.com/t/standardized-table-aliases/17159/8 "2013-03-12T09:49:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Alexander.Maximov](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/alexander.maximov/32/114_2.png) [@Alexander.Maximov](https://forums.toadworld.com/u/Alexander.Maximov)\
**Post date:** [March 12, 2013, 9:51am UTC](https://forums.toadworld.com/t/standardized-table-aliases/17159/9 "2013-03-12T09:51:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![s.bertolotti](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@s.bertolotti](https://forums.toadworld.com/u/s.bertolotti)\
**Post date:** [March 12, 2013, 9:58am UTC](https://forums.toadworld.com/t/standardized-table-aliases/17159/10 "2013-03-12T09:58:46Z")

</div>

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

Best regards.

Sergio Bertolotti

---

<div class="post-metadata">

**Author:** ![DavidStein](https://avatars.discourse-cdn.com/v4/letter/d/cab0a1/32.png) [@DavidStein](https://forums.toadworld.com/u/DavidStein)\
**Post date:** [May 17, 2013, 5:03pm UTC](https://forums.toadworld.com/t/standardized-table-aliases/17159/11 "2013-05-17T17:03:02Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Alexander.Maximov](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/alexander.maximov/32/114_2.png) [@Alexander.Maximov](https://forums.toadworld.com/u/Alexander.Maximov)\
**Post date:** [May 17, 2013, 5:51pm UTC](https://forums.toadworld.com/t/standardized-table-aliases/17159/12 "2013-05-17T17:51:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![s.bertolotti](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@s.bertolotti](https://forums.toadworld.com/u/s.bertolotti)\
**Post date:** [March 2, 2014, 6:51am UTC](https://forums.toadworld.com/t/standardized-table-aliases/17159/13 "2014-03-02T06:51:35Z")

</div>

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
