SQL Server Mgmt Studio Templates
Here’s a little feature that has been shown to me multiple times over the years. Every time I see it I get all excited by the possibilities — then (sadly) quickly forget it. This time I hope that by writing it down I’ll remember longer… Enjoy the pictures!
It turns out that SQL Server Management Studio has a nifty little option to speed up many, if not most, database tasks. Just find the Template Explorer under the View menu:
(note: my understanding is this is the same for 2005 and 2008 versions. The pictures below are from 2005)

This opens a new panel on the right side of SSMS (by default). Tons of tasks are listed. For instance, suppose you want to create a new table. Drill down to it and then double-click.

That leads to the template opened in a new SQL editor window.

But look at all those angle brackets. We’re not done quite yet. In the past I would start editing all those to replace my own values manually. Today Chris Randall showed me a better way while on a bit of a “side trip” during a test prep session.
Under the Query menu, select “Specify Values for Template Parameters…”

Now you get this slick little dialog. Set your values, click OK and you have a script ready to go.

Great tip, huh?
Check out the template list sometime, it is huge! I’m sure it is documented somewhere… but I couldn’t find a full list of all the stuff it holds.
Possibly Related posts:
- SQL Server in the Cloud
- Learned a bit about SQL Server Full Text Search
- Tiny Wi-Fi rant, New Meebo feature and SQL Server observation
- One Week Full of SQL Server DTS Development
- Visual Studio Express Tools Updated




