views:

19

answers:

3

Hi There are many tools out there some free and some not that offer a codesnippet facility. For some reasons in the company I work for they dont want to install or buy any third party stuff.

I need to work with just sql server 2008. Is there a way to modify the templates so that when you choose create new SP it loads the custom sp. In a nutshell I would like to know either if I can have code snippets in sql server 2008 without using third party tool or how i can modify templates.

Any suggestions?

Thanks a lot

+1  A: 

SQL Server Mangement Studio has always supported the use of templates that can serve as "snippets" - see the MSDN docs on how to use Templates.

This is built-in, free, no cost, no install - just use it. It's quite useful to create your own set of scripts as custom templates for those that you use frequently.

marc_s
So are you saying that there is no snippet facility EG type something in the editor and it shows in the editor like sql prompt etc..
@devnet247: no, something like this is *not* available in SQL Server Mgmt Studio - for that, you need additional tools like SQL Prompt
marc_s
A: 

In Management Studio, View -> Template Explorer (or just CTRL + ALT + T) In the template explorer, you just locate the template you want to change, right click and "Edit"

Vidar Nordnes
thanks for your reply.Is there a facility like typing something like EG "createsp" in the editor and my template appears?
Not that I'm aware of, and I doubt it. You can however change the default template for when you right click and choose "New Stored Procedure" in Object Explorer
Vidar Nordnes