开发者

Where are the database project and item templates in VS2010?

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:

CREATE PROCEDURE $SchemaQualifiedObjectName$
    @param1 int = 0,
    @param2 int
AS
    SELECT @param1, @param2
RETURN 0

$SchemaQualifiedObjectName$ gets replaced with the database object name when you add the item to your VS2010 Database project.


I posted this question on MSDN and eventually got a response from a Microsoftie, Ziwei Chen. These files are located here (if you installed VS2010 in the default location):

C:\Program Files\Microsoft Visual Studio 10.0\VSTSDB\ProjectItems

I don't know why I couldn't find it there; I used the search feature in Windows Explorer -- which does sometimes work oddly. In XP at least.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜