It's possible to define your own custom templates for normal project types, such as templates for C# files, for a Class Library project.
What about a 'Database Project' scenario?
I would like to define a standard template for adding a stored procedure, which uses the company's conventions for all stored procedures, such as standard comments at the top.
After looking through an MSDN article on the topic, it seems as though the Database Project isn't supported:
Figure 5 TemplateData Elements for an Item
ProjectType | Indicates the type of project that开发者_运维问答 this item can be added to. Possible values include CSharp, VisualBasic, VisualC, JSharp, and Web.
you can created customized project item templates for the database project , we do it all the time
the item must be placed in the following folder:
C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\Templates\Database Project Items
and then you can select it
Found it:
C:\Program Files\Microsoft Visual Studio 10.0\VSTSDB\Extensions\SqlServer\Items
It's not the project template you're after, it's the item templates for each type of object.
You can achieve the same result using code snippets. Once you have created your snippet (I copy/pasted one of the built-in SQL snippets), right click in your script file and select "Insert Snippet..."
The keyword replacement works nicely.
Please see: Create Reusable Project And Item Templates For Your Development Team
VS Ref: Visual Studio Templates
精彩评论