THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | |
in Search

Jamie Thomson

This is the blog of Jamie Thomson, a freelance data mangler in London

Creating your own SQL snippets in SSDT

SQL Server Data Tools (SSDT) has a neat feature where you can add snippets into your scripts via the right-click context menu:

image

I’m finding it very useful indeed. The same feature exists in SQL Server Management Studio (SSMS) as well by the way:

image

One thing I really wanted to be able to do was create my own snippets for SSDT and I ventured to the SSDT forum to ask if it was possible. Turns out the answer is “yes” and Gert Drapers replied to my thread by providing an excellent run through of how to do it. What Gert’s post didn’t quite clarify is that if you follow his instructions then you have to manually edit the .snippet file that you created so that the language is set to SQL_SSDT:

image

(well, I had to do that anyway)

Once you do that you’ll be able to import the snippet into Visual Studio (Gert’s post shows you how) and thereafter your snippets will show up in the snippets menu:

image

Very handy indeed.

@Jamiet

Published Monday, April 22, 2013 11:33 PM by jamiet

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

CB said:

I have been using autoHotKey's hotstrings feature for years... gives me my snippet's in all applications.

I fixed the escaping in the example Hotstring Helper to work with code.

http://www.autohotkey.com/docs/Hotstrings.htm

April 23, 2013 3:56 PM

Leave a Comment

(required) 
(required) 
Submit

This Blog

Syndication

Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement