Export (0) Print
Expand All
1 out of 5 rated this helpful - Rate this topic

Using SQL Server Management Studio Templates

Templates are boilerplate files containing SQL scripts that help you create objects in the database. Microsoft SQL Server 2005 provides a variety of templates. The first time the template explorer is opened, a copy of the templates is placed in the users Documents and Settings folder under Application Data\Microsoft\Microsoft SQL Server\90\Tools\Shell\Templates. Templates are available for solutions, projects, and various types of code editors. Templates are available to create objects such as databases, tables, views, indexes, stored procedures, triggers, statistics, and functions. In addition, there are templates that help you to manage your server by creating extended properties, linked servers, logins, roles, users, and templates for Analysis Services, and SQL Server 2005 Compact Edition.

The template scripts provided with SQL Server Management Studio contain parameters to help you customize the code. Template parameter definitions use this format <parameter_name, data_type, value>, where:

  • parameter_name is the name of the parameter in the script.
  • data_type is the data type of the parameter.
  • value is the value that is to replace every occurrence of the parameter in the script.

Use the Replace Template Parameters dialog box to insert values into the script.

Create custom templates for tasks you perform frequently. Organize your custom scripts into the existing folders or create a new folder structure.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.