Qualify Ojects in SQL (Add square brackets)
When formatting SQL, add an option to force all possible columns/objects/whatever to be qualified with square brackets. So:
CREATE TABLE #qqqqq (aaaaa INT,bbbbb INT,ccccc VARCHAR(5));
Becomes: CREATE TABLE [#qqqqq] ([aaaaa] INT,[bbbbb] INT,[ccccc] VARCHAR(5));
Or: CREATE TABLE [#qqqqq] ([aaaaa] [INT],[bbbbb] [INT],[ccccc] [VARCHAR](5));
![](https://secure.gravatar.com/avatar/a683a6c84e468c2eea5ec0a2471a5ab6?size=40&default=https%3A%2F%2Fassets.uvcdn.com%2Fpkg%2Fadmin%2Ficons%2Fuser_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)
This is included in SQL Prompt 6.5 which you can download from http://www.red-gate.com/products/sql-development/sql-prompt/
-
Paul Shearing commented
Yes I agree. I much prefer the look of code with square brackets around database, schema, table and field names, even where such are not required (i.e. white-space in the names). I think it significantly aids readability. Such a feature would save me typing time and ensure consistency in my SQL coding.
-
Phil commented
It would also be helpful to have an option to add square brackets only for reserved word or a list of names that can be managed by the user.