Insert Snippet Feature in SSMS in Denali CTP1 – Usability Enhancements in SSMS in SQL Server code-named Denali – Part 2

As part of the various attractive usability enhancements in SQL Server Management Studio (SSMS) in SQL Server code-named Denali, one of the features is Insert Snippet. This feature allows us to directly add the code snippets available in Template Explorer in SSMS to the query window directly from within the current query window without requiring opening of Template Explorer and then dragging the required snippet.
Here is how this feature works. Following are the step by step instructions for adding code snippets using Insert Snippet feature.
1. Right click in the query window and select Insert Snippet from from context menu as shown below. Alternatively, you can press Ctrl+K and then Ctrl+X.

2. On selecting Insert Snippet from context menu, it brings up Insert Snippet drop down menu with the list of folders from Template Explorer like Function, Index, Login etc. each one of them contains the scripts related to Functions, Indexes, Logins etc. respectively. Let us select Index folder from the drop down menu as shown below.

3. On selecting the appropriate folder like Index folder as shown above, you will be presented with a list of scripts related to common operations that can be performed with Indexes like Create Basic Index, Create Unique Non-Clustered Index etc. Select the appropriate script based on the type of operation that you want to perform, for example Create Unique Non-Clustered Index as shown below.

4. Now when you select the appropriate script from the context menu as shown above, corresponding code snippet will be inserted into the active/current query window from the script (.sql) from the Template Explorer as shown below.

However, while using this feature in CTP1 release, I found that all the available templates in Template Explorer are not listed in the drop down list. I even noticed that the User-Defined Folders/Templates are also not available in the Insert Snippets feature drop-down. I have created an item on this on Microsoft Connect. Please click on the below link to see the details and vote.

Note: You need to sign-in to Connect Site to view & vote for any Features/Bugs.

I had previously written an article on the use of Template Explorer from SQL Server Management Studio (SSMS) and you can read that here – T-SQL Coding Made Easy with Inbuilt SQL Server Templates.

Advertisements

About Dattatrey Sindol (Datta)

Datta is a Microsoft BI Enthusiast, passionate developer, and a blogger. View Full Profile

Posted on January 3, 2011, in SQL Server, SQL Server 2012, SSMS. Bookmark the permalink. 2 Comments.

  1. "I found that all the available templates in Template Explorer are not listed in the drop down list. I even noticed that the User-Defined Folders/Templates are also not available in the Insert Snippets feature drop-down." Snippet list is not populating using Template Explorer item. In Tools->Code Snippent Managers… we have to add require snippent

  1. Pingback: SQL Server 2012 – SQL Server Management Studio (SSMS) Enhancements – Learning Resources « Datta's Ramblings on Business Intelligence 'N' Life

What are your thoughts?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s