SQL Server Snippets

A T-SQL Code Snippet is a template that contains a T-SQL expression or the basic structure of a block. With SQL Server 2012, you can quickly type repeated T-SQL statements with the snippet feature added to SSMS.

You can add predefined snippets provided by SQL Server or create your own. In SSMS, you can see the snippets that come as default or that you have added with the Code Snippet Manager located in the Tools Menu, add and remove these snippets.

To use snippets on the Query screen, you can use Intellisense> Insert Snippet or Ctrl + K from the Edit menu, then open the snippet menu with the Ctrl + X shortcut and add what you want. If you want to use your expression in a BEGIN, IF, or WHILE block, you can use the Ctrl+K shortcut followed by Ctrl+S to use surround-with snippet.

--

--