I'm wondering if there's a keyboard shortcut in SSMS to surround a selected column name (or an uninterupted sequence of characters for the given cursor position) with the [ and ] chars.
So if I have user_id
and would press something like CTRL + SHIFT + [ + ]
it would turn into [user_id]
. Is there such a keyboard shortcut?
Ctrl++ (plus character) is the keyboard shortcut to insert rows or columns. If you are using a laptop keyboard you can press Ctrl+Shift+= (equal sign). Ctrl+- (minus character) is the keyboard shortcut to delete rows or columns.
SQL Naming and Statement Rules. Was this helpful? The rules for naming database objects (such as tables, columns, views, and database procedures) are as follows: Names can contain only alphanumeric characters and must begin with an alphabetic character or an underscore (_).
Really - just don't do it. Think of this as a formatting thing and do any special naming of columns in your presentation layer. Honestly, anyone who ever has to use your tables in the future will curse you. We usually don't suggest you using special characters in column name.
The shortcut key to group rows in Excel is Alt + Shift + Right Arrow. To use this shortcut key, simply select the range of cells that you want to group together and then press Alt + Shift + Right Arrow on your keyboard. Excel will automatically group the data together.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With