ALIAS options are great

Discussion of open issues, suggestions and bugs regarding database management and development tools for SQL Server
Post Reply
tlbignerd
Posts: 5
Joined: Thu 02 Jun 2011 16:55

ALIAS options are great

Post by tlbignerd » Fri 10 Jun 2011 20:43

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 :)

.jp
Devart Team
Posts: 345
Joined: Wed 09 Sep 2009 06:55
Location: devart

Post by .jp » Tue 14 Jun 2011 07:33

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?

tlbignerd
Posts: 5
Joined: Thu 02 Jun 2011 16:55

Post by tlbignerd » Tue 14 Jun 2011 13:41

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.

.jp
Devart Team
Posts: 345
Joined: Wed 09 Sep 2009 06:55
Location: devart

Post by .jp » Tue 14 Jun 2011 14:10

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.

tlbignerd
Posts: 5
Joined: Thu 02 Jun 2011 16:55

Post by tlbignerd » Tue 14 Jun 2011 14:27

Thanks for the quick reply. I'll just export my settings for now, and import whenever I load Enterprise Manager.

Post Reply