Options

Remove Unnecessary Square Brackets Exceptions

ggeierggeier Posts: 30 Bronze 2
edited December 1, 2016 4:28PM in SQL Prompt
Is there a way to have the "Remove unnecessary square brackets" feature to ignore brackets around keywords?

For example, if I had this query:
select
	  f.[katy_perry_id]
	 ,f.[name]
	 ,f.[definition]
	 ,f.[tswift_id]
	 ,f.[is_awesome]
from [stars].[katy_perry] f

I would like it to be formatted like this:
select
	  f.katy_perry_id
	 ,f.[name]
	 ,f.tswift_id
	 ,f.is_awesome
from stars.katy_perry f

It's currently being formatted as this:
select
	  f.katy_perry_id
	 ,f.name
	 ,f.tswift_id
	 ,f.is_awesome
from stars.katy_perry f

Thanks.

Comments

  • Options
    Aaron LAaron L Posts: 596 New member
    Hi ggeier,

    Unfortunately at the moment SQL Prompt doesn't have a setting to achieve what you want. As [name] isn't a full keyword the brackets are unnecessary. If you had a column named with a full keyword like or [select] however then the brackets would be necessary and kept.

    I think we've got a UserVoice request for improving this here: https://redgate.uservoice.com/forums/94 ... ssary-brac

    If that's what you're thinking of please do add your vote! We use the votes to help prioritise what will be worked on next and you'll get an email when we release a new build with it in.

    Thanks,
    Aaron.
  • Options
    ggeierggeier Posts: 30 Bronze 2
    That uservoice is exactly what I mean. I voted for it, thanks.
Sign In or Register to comment.