0

Working in SQL Server Management Studio, when using the text editor:

Is there any way to automatically wrap schema names, table names, column names and other identifiers with brackets so I don't have to put them manually, just in the same way it does it when it auto-generates queries? Is there (perhaps) any Intellisense feature I'm missing?

EDIT: see accepted answer

1

There is no native function for this yet in SSMS. You can view the IntelliSense properties document here.

APEX makes a free formatting tool and there is another tool called Poor Man's T-SQL. RedGate also makes a tool that is paid, all three work nicely. I am sure there are other tools out there too.

|improve this answer|||||
  • Hopefully MS will integrate some of these features one day. Will take a look to the suggestions. – Petaflop Apr 6 '18 at 6:22
1

From the options given by @Shaulinator in his answer, ApexSQL Refactor does the job very nicely, integrates with SSMS and is free.

This is the particular option that I needed:

enter image description here

|improve this answer|||||
0

there is a built in option: Tools/Options/SQL Object Explorer/Commands --> Drag/Drop Set Surround object names with brackets when dragged to False.

|improve this answer|||||
  • I found it set to True by default, and it only wraps identifiers when dragging the objects from the Object Explorer, not when typing their names which is what I'm looking for. – Petaflop Dec 10 '18 at 9:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.