Using SSMS Snippets

A T-SQL code snippet is a new type of template that was added in SQL Server 2012. The templates are another great starting point when writing new T-SQL statements in the Database Engine Query Editor. They are tightly integrated into the query editor window and are supported by IntelliSense.

Snippets can be accessed in a number of different ways in SSMS. One easy way to access them is to right-click in a query editor window and choose Insert Snippet, which displays the snippet picker tooltip, as shown in Figure 4.29.


FIGURE 4.29 Snippet picker tooltip.

When you select the desired snippet, the related T-SQL statements are added ...

Get Microsoft® SQL Server 2012 Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.