Used to be I was able to find the database project and item templates in VS2008 and modify them to add things like SourceSafe comment boxes, copyright notices, and generally customize them for our installation preferences.
But I absolutely cannot find these templates for VS2010. Correction, I can find some, but the odd thing is they are not the ones that are actually being used. The templates were at one time in
C:\Program Files\Microsoft Visual Studio 10.0\Common7\Tools\Templates\Database Project Items
The above folder does seem to contain templates that might be used when running VS2008, but the difference between these templates and the ones that generate when I add a new stored procedure, for instance, is striking. Here’s part of the stored procedure template…
CREATE Procedure Stored_Procedure_Name
/*
(
@parameter1 int = 5,
@parameter2 datatype OUTPUT
)
*/
AS
But what is generated when creating a new stored procedure looks like…
CREATE PROCEDURE [dbo].[AAAProc]
(
@param1 int = 0,
@param2 int
)
AS
/*
Purpose :
Date Created :
Author :
Notes :
--$Archive: $
--$History: $
--
*/
SELECT @param1, @param2
But I can’t find it. It’s got to be somewhere. Does anyone know?
By default, the templates for new database objects are located here:
C:\Program Files\Microsoft Visual Studio 10.0\VSTSDB\Extensions\SqlServer\Items
For example, the default stored procedure template (Create Procedure 2008.sql) looks like this:
$SchemaQualifiedObjectName$ gets replaced with the database object name when you add the item to your VS2010 Database project.