In SQL Server Management Studio 2012 Microsoft introduced “snippets”. These are shortcuts to commonly used pieces of code that can be inserted in the query window (a similar facility for SQL 2008 was available with the free
SSMSTools Pack but the developer now charges for the 2012 version). When you right click on the window a menu similar to an Intellisense shortcut menu pops up where you can choose some pre-cooked pieces of TSQL to insert. The good news is that it is possible to create your own snippets that appear as a menu option of My Code Snippets. The bad news is from Microsoft’s
site on the subject you have to learn yet another xml schema to create one.
|
Click to enlarge |
But wait, there’s more good news…
some kind soul has created a nifty little tool that will do all the hard work for us,
Snippets Generator. All you have to do is copy your code in to the main window, fill in the name, author and description fields, click
Generate Snippet and it saves the file in your code snippets folder.
|
Click to enlarge |
Next time you right-click in the query window and choose
Insert Snippet –>
My Code Snippet
Comments
Post a Comment