Page 1 of 1

ALIAS options are great

Posted: Fri 10 Jun 2011 20:43
by tlbignerd
I love the alias option in SQL Complete. I especially want to thank you for the option to remove prefixes for tables. I'd been having problems where my app_submission table was getting named the reserved word "as" which was driving me crazy. I almost posted a topic until I noticed that prefixes can be removed. Now I'm in heaven :)

Posted: Tue 14 Jun 2011 07:33
by .jp
Yes, you can find the following options to tune the alias generation behaviour:
- Generate alias on commit;
- Automatically generate AS clause
- Exclude following name prefixes;
- Exclude following names;

If generated alias is the same as a keyword, SQL Complete will quote it. Was it the wrong behaviour for you? Should SQL Complete add an extra symbol (digit) to the generated alias to avoid quotation, for example [as] -> as1?

Posted: Tue 14 Jun 2011 13:41
by tlbignerd
The field did get bracketed sort-of. So, it came out as:

Code: Select all

SELECT
    *
FROM
    app_in AS ai
    INNER JOIN app_Sub AS as ON ai.id = [as].id
So where the AS clause was defined it didn't use brackets, but in the join and later it did. I do think my preference would be to add a 1 at the end (ex. as1) instead of the brackets. It drives me crazy using brackets when typing aliases or field names.

I'm also now noticing the prefix exclusions seem to get lost when I close Enterprise Manager. I just discovered it yesterday, so I haven't troubleshot it in any way, may start a new thread if it's really a problem, and not something I'm doing wrong.

Posted: Tue 14 Jun 2011 14:10
by .jp
tlbignerd wrote:... I do think my preference would be to add a 1 at the end (ex. as1) instead of the brackets. ...
I've added this suggestion to our development plan.
tlbignerd wrote:I'm also now noticing the prefix exclusions seem to get lost when I close Enterprise Manager. ...
Yes, it's a bug. We'll fix it in one of the next builds of SQL Complete. I'll notify you as soon as the build with the fix is available to download.
Sorry for the inconvenience.

Posted: Tue 14 Jun 2011 14:27
by tlbignerd
Thanks for the quick reply. I'll just export my settings for now, and import whenever I load Enterprise Manager.