Is there some way to have a shortcut in SQL Server Management Studio (SSMS) that when text is selected, it wraps that text in an IsNull() statement?
For example, I highl
You can get this done using snippets. It's not exactly a simple shortcut, but a few keystrokes will get you there.
First you need to create a snippet like this:
ISNULL
Inserts ISNULL function
Luis Cazares
SurroundsWith
Save this as a .snippet
file and save it on a folder destined for snippets. You could use the one set as default. To know which folder is your default or to add a different folder, go to the Code Snippets Manager
in the Tools menu for SSMS.
Once your snippet is on a registered location, select the code, press Ctrl+K,Ctrl+S
and the snippets context menu will appear. You can traverse it by starting typing the folder and snippet name and pressing Enter or Right when getting there.
It's probably not worth it for short snippets, but for larger ones it's amazing. I wrote a more detailed explanation in here.