SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

SQL Prompt Tips #3 - Snippet Placeholder $Paste$

By Steve Jones, (first published: 2012/05/01)

SQL Prompt is an amazing productivity enhancement tool for SQL developers. However there are a number of features that many people are not aware of. These tips will help you learn more about ways in which SQL Prompt can speed your development. We urge you to try each of these tips out for a week or two and see if you find them helpful.

There's a link to a video demonstration of this tip as well.

Snippet Placeholders

One of the neat things that SQL Prompt allows you to do is store code in snippets. Snippets are like templates in SSMS, but they can be inserted into your queries with a few keystrokes, saving you lots of time. For example, one of the most common snippets is "ssf", which is included with SQL Prompt. If I type ssf, I'll see this in SQL Prompt.

The tip that pops up below, shows me this is a script, and there description is "SELECT * FROM fragment". If I wait a second, I'll actually get a pop up with the code in the snippet (as shown here).

If I hit tab, or enter, then I'll get that code inserted.

However I can change this snippet slightly. I can find it in the Snippet Manager and hit Edit.

From there, I can add the $PASTE$ placeholder into my code. 

This will place the contents of my clipboard in the script when it's inserted. I click OK and save this.

Now I return to my query window and copy the name of a table.

I then erase everything in my window. When I type "ssf" and hit tab, I get this:

There are a variety of placeholders, and we'll discuss others in another tip, but they are very handy for customizing your snippets, and speeding up your development.


You can see a video demonstration of this tip below from Tom Crossman, one of Red Gate's talented employees working on SQL Prompt.

Total article views: 1299 | Views in the last 30 days: 3
Related Articles

The Snippet Manager in SQL Prompt

I love SQL Prompt, since it makes T-SQL coding quicker and easier. One of the handiest things is the...


Using Code Snippets in SSMS

Snippets will allow you to code faster by inserting chunks of code with few key strokes.


Share t-sql snippets to the team with SQL Prompt

Red-Gate SQL Prompt is a plugin for SQL Server Management Studio that makes the developers life easi...


Using TRY..CATCH in SQL Prompt

I learned something new recently about SQL Prompt. I was working on documenting and experimenting wi...


How to Unlock Your Team's Creative Power with SQL Prompt and a VCS

Extend SQL Prompt's functionality by connecting your snippets to version control

quick tips    
sql prompt