Wednesday, March 29, 2006
« Windows backward compatibility worth the... | Main | Studying other people’s code »

The only way I can find to change the template for the "New Stored Procedure..." command in SQL Server Management Studio is by digging around in the file system:

C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\sqlworkbenchprojectitems\Sql\Stored Procedure\Create Stored Procedure (New Menu).sql

This short and easy to remember path seems to be the file that matches the command.  If you find a better way, please let me know!

Thursday, April 06, 2006 9:21:56 PM (Central Daylight Time, UTC-05:00)
In Management Studio, click View --> Template Explorer. I think that does what you are looking for. I also saw something there that I had not noticed before which is the ability to set up parameters which can be quickly replaced. For example, if you put this in your template:

<Author,varchar(100),Name>

- Author is what it asks for
- varchar(100) is the type it expects
- Name is the default

In this particular case, why wouldn't you just put your name in the template though?

Oh, the important part: press Ctrl-Shift-M to fill in the values. It could be good for procedure name, proc comments, etc
Mick
Thursday, April 06, 2006 10:32:42 PM (Central Daylight Time, UTC-05:00)
The template explorer templates are actually stored per windows profile and are different from the one that is pulled using the "New Stored Procedure..." command. I typically don't use the template explorer since I have to drill down to find the template I want... the context menu is just so handy. I know, I know - I'm picky.

Yes! Parameter replacement is very cool. I didn't realize that you could do it until SQL Server Management Studio (2005) came out. The prompt at the top of the 2005 templates clued me in - very cool.

Name
E-mail
(will show your gravatar icon)
Home page

Comment (Some html is allowed: a@href@title, b, blockquote@cite, em, i, strike, strong, sub, super, u)  

Enter the code shown (prevents robots):