Insert Snippet Feature in SSMS in Denali CTP1 – Usability Enhancements in SSMS in SQL Server code-named Denali – Part 2
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.
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.