There's an option in SA - Options > SQL Assistance > Aliases called Custom Aliases. It can be set to either Regular names or Regular expressions. I've found nothing in the help regarding those. What do they do?

Also, there's something fishy with auto adding aliases. It's supposed to automatically add a number to the alias in case there's already one with exactly the same name. But it does not always work.
First I added an INNER JOIN to the original table the ertekesites.v_eladas_tetelek view references. I have v_ in Ignore Name Prefixes, so it would have two ets in the statement but auto-numbering kicked in and I got et2.
After that I added a self join to the ertekesites.v_eladas_tetelek view, which would also get et as alias when alone due to Ignore Name Prefixes, and it too, got et2. But when I tried another table in another schema (volan.eladas_tetel) that got the same et alias, it wasn't renamed.

About use of custom aliases, consider having a table named AbraCodabraAccountPayablesFin which you often reference in the code. If you let the application auto-generate an alias for that one, it would come out as acapf. But in your code for accounts payable transactions you may simply refer to it as AP. You can use the custom aliases property to specify fixed aliases like AP.

The property is a two column table in object name field [ TAB] alias field format. The alias field can be a static text like AP in my example above, or a regular expression using regex replace syntax

Wed Sep 06, 2017 11:17 am

gemisigo

Joined: 11 Mar 2010Posts: 1401

The Custom Alias sounds interesting. Can on use regular expression for object name as well? Also, does auto-numbering apply to created alias in case of conflict?

Thu Sep 07, 2017 3:41 am

SysOpSite Admin

Joined: 26 Nov 2006Posts: 6509

Quote:

Can on use regular expression for object name as well?

Yes, it's kind of a replace regex expression that you can use to calculate the alias from the name. I don't know if it can automatically add numbers to repeating aliases in this case, and in case of predefined aliases, it's a grey undocumented area.