Add/remove alias definition
a.higgins
Posts: 90 Bronze 2
The new format action for applying column alias style is simply incredible: as one of the people that submitted requests for that, let me say thank you!
Is there a way to extend this functionality to automatically add the alias for all columns, even those that currently do not have an alias defined?
For example, my current preferred alias style is "alias = column". Now that SQL Prompt has the ability to align aliases, I've gotten into the habit of explicitly defining an alias for every column, even if the alias is the same as the underlying field.
I'd like SQL Prompt to take an input query like this:
and turn it into
Is there a way to extend this functionality to automatically add the alias for all columns, even those that currently do not have an alias defined?
For example, my current preferred alias style is "alias = column". Now that SQL Prompt has the ability to align aliases, I've gotten into the habit of explicitly defining an alias for every column, even if the alias is the same as the underlying field.
I'd like SQL Prompt to take an input query like this:
;WITH CTE AS ( SELECT a = 1 ,b = 2 ,c = 3 ) SELECT CTE.a ,CTE.b ,TOTAL = CTE.a + CTE.b - CTE.c FROM CTE
and turn it into
SELECT a = CTE.a ,b = CTE.b ,TOTAL = CTE.a + CTE.b - CTE.c FROM CTE
Comments
Thanks for the great feedback and suggestion.
Would it be possible to log your suggestion as a separate UserVoice request? While it's related to applying column alias styles, it's a substantial feature in its own right so we would have to plan this separately.
Thanks,
James
Redgate Software