question

wdupleich avatar image
wdupleich asked

SQL Tool for creating snipets

Is there a tool out there that you can create SQL snipets so you can execute them when ever you need to?
sqltools
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Matt Whitfield avatar image
Matt Whitfield answered
My [sql editor][1] supports both Visual Studio style snippets and shortcuts (e.g. the classic 'ssf' -> 'SELECT * FROM'). [SQL Prompt][2] for SSMS provides code-completion in place and supports shortcuts, and [SSMS Tools Pack][3] supports only shortcuts (but it is free). You can create the VS style snippets using [Snippy][4]. [1]: http://www.atlantis-interactive.co.uk/products/sqleverywhere/default.aspx [2]: http://www.red-gate.com/products/SQL_Prompt/index.htm [3]: http://www.ssmstoolspack.com/ [4]: http://snippy.codeplex.com/
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Grant Fritchey avatar image Grant Fritchey ♦♦ commented ·
Excellent summary.
0 Likes 0 ·
Grant Fritchey avatar image
Grant Fritchey answered
If you're not interested in spending money, you can use the Template Explorer in Management Studio. While you can't call up the scripts through hot key commands, you can imbed parameters in the scripts and then use a hot key, CTL-SHIFT-M, to call up a window to supply values for those parameters which are then automatically filled in. Actually, you can use that hot key with snippets stored in Matt's software or Red Gate SQL Prompt, making those tools even more powerful.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ThomasRushton avatar image
ThomasRushton answered
SQL Server 2005 & SQL Server 2008 Management Studios do have a feature that allows for this. Try pressing "CTRL+1". That should execute sp_who, unless someone's been at your computer. To get at this and change what's executed, select "Options" from the "Tools" menu in SSMS. In the treeview on the left, expand the "Environment" node, and select "Keyboard". Here you can put in your little code snippets. There are limitations, but I don't know what they are...
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Mark avatar image Mark commented ·
Yes, I like to have "Select TOP 200 * FROM " for Ctrl-0.
0 Likes 0 ·
DaniSQL avatar image DaniSQL commented ·
I like to have Adam Machanic's sp_WhoIsActive at Ctrl+F1
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.