Mitch’s Quick Tips – #2 SQL 2012 IntelliSense Code Snippets

How often do you forget the syntax for simple things like creating roles, logins or triggers. You might not have to create them very often, so simple tasks like these might occasionally get truncated from your brain memory. Well, SQL 2012 has made life much easier for us by adding what they call Code Snippets. These snippets will allow us to simple create a script shell for all sorts of objects and they are super simple to use. Here is how you use them.

When you are in SSMS (SQL Server management Studio) and open a New Query window, you can simply right-click in that window and click on Insert Snippet… (You can also type Crtl+K, Ctrl+X)


This will display server different object in which you can create a generic code snippet for. In this case, we will look at creating a basic Stored Procedure shell. Once you choose the Create a single stored procedure option, generic code is created for you to use.


All you have to do is fill in the highlighted sections.


The same is true for all of the other objects listed in the snippets. You might already know the syntax to all of this, most of us DBA’s do, but this is also a no brainer and time saver in the sense that it is very easy to click n’ create. This can help new developers and old developers alike.

Take a minute and check it out.

This entry was posted in Uncategorized. Bookmark the permalink.

3 Responses to Mitch’s Quick Tips – #2 SQL 2012 IntelliSense Code Snippets

  1. Pingback: Something for the Weekend - SQL Server Links 05/04/13 • John Sansom

  2. SQLDCH says:

    Thanks Mitch, this is very helpful

  3. Pingback: Mitch’s Quick Tips – #3 SQL 2012 IntelliSense Custom Code Snippets | Mitch's Pitch

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s