How can we help you today? How can we help you today?

Non-aliased query uses Aliases intellisense

select * from MyTable where [ctrl] + [space] + "MyT" + [Down arrow] (highlighted "MyTableID") + [enter]
I did not alias MyTable; however, the insertion of MyTableID included an alias:
select * from MyTable where [MT].MyTableID

Also, found this while trying to re-create the above issue:
When typing:
use northwind
go
select * from Employees WHERE [ctrl] + [space] + ti

There are no options in the common objects list (it is disabled, but focused), however there are Columns. I can [crtl] +[arrow] over to the columns.
HotAir
0

Comments

4 comments

  • rjpaulsen
    On a related note, if you use a custom alias and then use SqlPrompt to instert a field, it will use the automatic alias value instead of the custom alias.

    In the example below, the table "Organization" is automatically aliased as "o", but I have chosen to use Org.
    SELECT * FROM Organization AS Org
    

    If using SqlPrompt to instert a field in the WHERE clause, you will get (Note the aliased named in the WHERE clause):
    SELECT * FROM Organization AS Org WHERE o.[OrgName] = 'Test'
    

    I'm not typing the query right now so I cannot test, but it may only occur if you leave out the 'AS' keyword when aliasing the table name.
    SELECT * FROM Organization Org WHERE o.[OrgName] = 'Test'
    
    rjpaulsen
    0
  • Tilman
    Hi,

    Thanks for posting.
    I did not alias MyTable; however, the insertion of MyTableID included an alias:

    What were the options settings when you encountered this? Did you manually remove the alias from MyTable? It's of course still a bug, i just need to be sure i'm reproducing it correctly.
    There are no options in the common objects list (it is disabled, but focused), however there are Columns. I can [crtl] +[arrow] over to the columns.

    We are aware of issues in this area and will address them for the final release.
    On a related note, if you use a custom alias and then use SqlPrompt to instert a field, it will use the automatic alias value instead of the custom alias.

    We've had a lot of requests for customization of the auto-aliases. We will try and come up with a solution that suits most.

    Regards,

    Tilman
    Tilman
    0
  • HotAir
    Tilman wrote:
    I did not alias MyTable; however, the insertion of MyTableID included an alias:

    What were the options settings when you encountered this? Did you manually remove the alias from MyTable? It's of course still a bug, i just need to be sure i'm reproducing it correctly.

    I am able to reproduce it. I did not remove the alias since I had typed the entire table name. I used SQLP3 only for column name in the where clause, to which it added an alias.

    Options I have checked are:
      Assign aliases to tables and views Qualify non-aliases columns with table or view name Auto-popup candidate list All Completion Keys
    HotAir
    0
  • Tilman
    Hi,

    Ok, so i understand how it happened. Basically, if Auto-aliasing is on it doesn't check whether the table actually has the alias or not. We will fix that for the final release.

    Regards,

    Tilman
    Tilman
    0

Add comment

Please sign in to leave a comment.