Keyboard shortcut to surround a column name with [ and ]
There's no keyboard shortcut out of the box that surrounds text in brackets, but you can you create your own using a custom snippet. You can check out this blog post to get clear steps but I'll list them briefly here.
Open notepad and paste in this xml. Save it as brackets.snippet:
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<_locDefinition xmlns="urn:locstudio">
<_locDefault _loc="locNone" />
<_locTag _loc="locData">Title</_locTag>
<_locTag _loc="locData">Description</_locTag>
<_locTag _loc="locData">Author</_locTag>
<_locTag _loc="locData">ToolTip</_locTag>
<_locTag _loc="locData">Default</_locTag>
</_locDefinition>
<CodeSnippet Format="1.0.0">
<Header>
<Title>Brackets</Title>
<Shortcut>br</Shortcut>
<Description>Snippet for Brackets</Description>
<Author>SQL Super Hero</Author>
<SnippetTypes>
<SnippetType>SurroundsWith</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>OpenBracket</ID>
<Default>[</Default>
</Literal>
<Literal>
<ID>CloseBracket</ID>
<Default>]</Default>
</Literal>
</Declarations>
<Code Language="SQL"><![CDATA[$OpenBracket$$selected$$CloseBracket$$end$]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
In SSMS, Go to Tools > Code Snippets Manager.
Click import. Find the Brackets.snippet file and click Open
Choose “My Code Snippets” as the location and click finish
Close and reopen SQL Server Management Studio
You should now be able to use the snippet to surround highlighted text in brackets. The keyboard shortcut to access the snippet is ctrl+k, ctrl+s
The most efficient way to do this is with the following sequence of key presses:
Highlight Desired Text > Ctrl+K,Ctrl+S > M > Enter > Enter > Enter