Template Explorer is a component of Microsoft SQL Server Management Studio that can be used with SQL code templates, using the code provided by templates, and eliminating the need to enter basic code every time.
To use Template Explorer:
1>. After you open the Microsoft SQL Server Management Studio main interface, choose View, Template Explorer, to open the Template browser window.
2>. The template Explorer is grouped by code type, and you can double-click the Create Database template under Open database to view the following:
3>. Position the cursor to the left window, where a query menu appears in the menu in Microsoft SQL Server Management Studio, and select query, specify values for template parameters.
4>. Open the Specify Values for template Parameters dialog box and enter the value test in the Value text box.
5>. After the input is complete, click OK to return to the query editing window for the code template, where the database_name value in the code in the template is replaced by the test value.
-- =============================================
-- Create database template
-- =============================================
USE master
GO
-- Drop the database if it already exists
IF EXISTS (
SELECT name
FROM sys.databases
WHERE name = N‘Test‘
)
DROP DATABASE Test
GO
CREATE DATABASE Test
GO
SQL Server series: Microsoft SQL Server Management Studio Template Explorer