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

Format SQL has started adding AS prior table object aliases

Previously, SQL Prompt preserved the the omission of `AS` on object aliases, however, as of this morning it has started adding it. As a simple example If I had the SQL below:
SELECT MT.MyColumn AS Col
It would change it to
SELECT MT.MyColumn AS Col
Previously it would have simply added the semicolon, as I prefer to not use AS when aliasing an object (although i do for columns).

I haven't performed an update to Prompt this morning, and I'm running the latest version, so not sure why the behaviour has suddenly changed. I had a look at the style options, and there's nothing to enable (or disable) he  use of AS for object aliasing.

Any ideas why this has changed and how to revert the behaviour?
Thom_A
0

Comments

4 comments

  • Alex B
    Hi @Thom_A,

    I don't think there is a way for it to have just reverted.  The aliases are controlled by a section outside the "Styles" bit in "SQL Prompt Options > Inserted code > Aliases":


    Has the "Include AS in alias definition" checkbox been checked? 

    I believe this could have happened if you imported a .sqlpromptsettings file perhaps.

    Kind regards,
    Alex
    Alex B
    0
  • Thom_A
    Hi @Alex B  I don't make use of the Aliases page in the SQL Prompt Options:




    Thom_A
    0
  • Alex B
    Hi @Thom_A,

    Apologies, I've muddled it - the section I put before is for when you are typing. 

    The AS being included during formatting is handled by this section on the SQL Prompt menu > Options > Format >Styles menu:


    If you uncheck that it should stop adding this during formatting! 

    Kind regards,
    Alex
    Alex B
    0
  • Thom_A
    Thanks Alex. It was set to "Remove", however, I changed the option to Add, saved, and then changed it back and it fixed the problem. Guessing there was a setting error somewhere and rewriting the settings fixed it.

    Thanks.
    Thom_A
    0

Add comment

Please sign in to leave a comment.