Add/remove alias definition

a.higginsa.higgins Posts: 90 Bronze 2
edited October 25, 2016 5:48AM in SQL Prompt
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:
;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

  • James RJames R Posts: 104 Silver 4
    Hi a.higgins,
    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
    Software Engineer
    Redgate Software
Sign In or Register to comment.