|
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
judahr
Joined: 09 Mar 2007 Posts: 319 Country: United States |
|
End is not an alias |
|
If you have a Begin End block like this:
Begin
Select
From Table1
End
when you try to add column names to the select without Table1 being aliased, all column names are prefixed with End. Resulting in the following:
Begin
Select End.Column1
From Table1
End
obviously is not valid.
|
|
Fri Mar 16, 2007 2:39 pm |
|
|
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7907
|
|
|
|
That's because it sees End in that place as an alias for Table1.
I agree with you that keywords should be excluded from alias searches, moreover aliases should be searched only on the same line.
I hope we can provide a fix this issue soon
|
|
Fri Mar 16, 2007 2:52 pm |
|
|
judahr
Joined: 09 Mar 2007 Posts: 319 Country: United States |
|
|
|
It seems it really doesn't like Begin End blocks. If you try to add additional columns to the select it doesn't know what to do and just starts suggesting tables.
Example:
Begin
Select ID
From Table t
End
Adding a comma after ID causes table names. Table is aliased in this example.
|
|
Fri Mar 16, 2007 3:01 pm |
|
|
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7907
|
|
|
|
I think it is still the same issue with aliases and End. If you remove "t" you are going to get column list, is you put back, the parser gets confused as it cannot find the table in the object list and considers the SELECT line separately from the rest, suggesting object list after the comma.
Enter any SQL statement between "t" and End and you are going to get the expected column list after the comma in the first SELECT.
|
|
Fri Mar 16, 2007 3:13 pm |
|
|
judahr
Joined: 09 Mar 2007 Posts: 319 Country: United States |
|
|
|
|
|
That's because it sees End in that place as an alias for Table1.
I agree with you that keywords should be excluded from alias searches, moreover aliases should be searched only on the same line.
I hope we can provide a fix this issue soon |
MSDN has a list of reserved keywords for SQL, SQL-92, and future. They recommend reserved keywords are not used for identifiers, so that is a fair restriction. Although more work, you could allow reserved keywords as long as the alias is delimited. This is allowed by Sql Server.
|
|
Fri Mar 16, 2007 3:15 pm |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|