Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The processes for creating and altering a template follow the same steps. All templates are stored in a central location and are available for every connection to SQL Server on that computer; therefore, templates are not database or server-restricted. The path to where they reside on my computer is C:\Users\RobinDewson\AppData\Roaming\Microsoft\SQL Server Management Studio\11.0\Templates\Sql. The preferred method, though, is to create a new node for templates from within Template Explorer by right-clicking and selecting New Folder.
Note Don’t create the folder directly in the
Sql folder, as this is not picked up by SQL Server Management Studio until you exit and reenter SQL Server Management Studio.
You could create different formats of templates for slightly different actions on tables. You saw the CREATE TABLE template previously, but what if you wanted a template that included a CREATE TABLE specification with an IDENTITY column? This is possible by taking a current template and upgrading it for a new template. In the following exercise, this is what you will be building, a new template by taking an existing template as a base and then creating a table from it.