Using Builtin Template in SQL Server

Sometimes we see developers and UI designers that are not familiar with databases (for example SQL Server). (How to frame a Query, write a Stored Procedure, function and so on?) They are therefore dependent on a DBA or DB Anchor. They don't even know how to start learning how to write a new Stored Procedure, Function, Create Table and so on. Most of the time they search sites to find the syntax of a simple SQL Query like create table query, create Stored Procedure and so on. But in SQL Server we have the option called Template Explorer. We can see most of the syntax like for Stored Procedure, function, Create Server role, create table, create login, Alter Stored Procedure and so on.

How to start with template explorer in SQL Server

1. Open SQL Server and go to the View tab.

view tab in sql server

2. Click on Template Explorer. The Template Browser pane will open on the right side.

template explorer

3. Expand any of the folders, like if you are searching for the syntax to create a new Stored Procedure. Click on the Stored Procedure folder and you will find various SQL Queries (for example Alter SP, Create SP, Drop SP and so on).

store procedure

4. Open any of the files and you will find the appropriate syntax (please find Create Sp Syntax Template).

Create Sp Syntax Template

5. Now also if you don't know how to define things in that template then go to the “Query” tab and click on “Specify Values for Template Parameters”.

Specify Values for Template Parameters

6. A small window will open and you can provide an appropriate value.

provide appropriate value

ok appropriate value

7. Click on Ok and your SP will be created.

store procedure create

8. You can check other syntax in a similar way and can learn SQL easily.