Format SQL has started adding AS prior table object aliases
Thom_A
Posts: 8 Bronze 2
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<br>FROM MyTable MT<br>It would change it to
SELECT MT.MyColumn AS Col<br>FROM MyTable AS MT;
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?
Tagged:
Best Answer
-
Alex B Posts: 1,157 Diamond 4Hi @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
Answers
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
Have you visited our Help Center?