Competition: What’s your favorite Redgate tool? Enter now.

Problem with square brackets in SQL Prompt 6.5.0.326

weswinklerweswinkler Posts: 54 New member
edited May 1, 2015 7:43PM in SQL Prompt
SQL Prompt 6.5.0.326 does not appear to honor my choice regarding adding or removing square brackets.
My option setting on the Format>Actions page has the "Add/remove square brackets" checkbox blank. I assume that means to make no change to any square brackets.

However, when I format a simple query
DELETE sts FROM [dbo].[ScheduleTimeSlots] sts INNER JOIN [dbo].[Schedules] s ON s.ScheduleId = sts.ScheduleId WHERE s.ScheduleJobId = 22

I receive
DELETE  sts
FROM    dbo.ScheduleTimeSlots sts
INNER JOIN dbo.Schedules s ON s.ScheduleId = sts.ScheduleId
WHERE   s.ScheduleJobId = 22

The layout for spacing and line breaks is expected, but I did NOT expect the square brackets to be removed.

What setting must I use to have SQL Prompt leave square brackets alone?

Comments

  • Aaron LAaron L Posts: 596 New member
    Hi weswinkler,

    Do you have "Qualify object names" ticked under format actions? Before we added a separate feature for enclosing all identifiers in brackets in 6.5 this was a pretty common way to add or remove square brackets.

    Now that we have both add and remove square brackets as separate features we plan on changing qualify object names so it will preserve the existing brackets. Sorry that this hasn't been implemented yet!

    Thanks,
    Aaron.
  • weswinklerweswinkler Posts: 54 New member
    Yes, I had "Qualify Object Names" ticked/checked.

    When I uncheck that option, the square brackets behave as expected.

    But, I still wish the interaction between the two could be separated.

    I like having the objects qualified; in fact I need it sometimes when working with objects in a non-dbo schema. I just don't want SQL Prompt to mess with square brackets unless I explicitly ask for it.

    I hope this is resolved in a future release.
  • KimNKimN Posts: 1 New member
    This is still an issues as of version 9.2.2.5855. Any plans to separate the logic of "Qualify object names" and "Add and remove square brackets"? It would be appreciated.
Sign In or Register to comment.