SQL Server– Template Explorer

Yesterday when I was about to leave office , I got a call from one of my friend. He wanted to know how to write a recursive query?I said use Template Explorer, Where you can get examples for recursive query but He was unaware of this feature of SQL server. So I thought to write on this.

SQL server provides number of templates which can be used to Create, Alter and Drop different database objects  like Table, Index, Triggers, View and many more. With the help of Template Explorer you can do DDL operation on object as well as you can learn How to write recursive query too.

Follow below steps to open the recursive query example:

Step 1- Open SQL Server Management Studio

Step 2 – Use shortcut key Ctrl + Alt + T or You can find this option under View-> Template Explorer



Step 3: Expand Recursive Queries section


We can create our own Custom Template, Refer How to create custom template?

When first time the template explorer is opened, a copy of the templates are placed in the user’s folder in C:\Users, under <username>\AppData\Roaming\Microsoft\SQL Server Management Studio\11.0\Templates. So that all users can have their own copy of templates.



About Sandip Pani

Sandip Pani is a Database/BI developer and speaker and is located in Bangalore, India. He has been working with SQL Server over 11 years. He is MCITP for SQL Server 2008 and specializes in SQL Server for application developers and performance and query tuning. His specialization is into Query Tuning and performance troubleshooting. He is working as Senior Technical Specilist for NextGen Healthcare. He is active in SQL community world. He share and enhance his knowledge of SQL Server by spending time at newsgroups and forums, reading and writing blogs, and attending and speaking at conferences.

View all posts by Sandip Pani →

Leave a Reply

Your email address will not be published.