Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

SQL Prompt Tips #3 - Snippet Placeholder $Paste$

By Steve Jones,

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.

Video

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: 164 | Views in the last 30 days: 2
 
Related Articles
FORUM

Masking Parameter prompts

Masking Parameter prompts

BLOG

SQL Prompt – new features in version 6.x

I’ve been using SQL Prompt for years. In September 2013, version 6 was released (quickly followed ...

BLOG

Quick SQL Prompt Tip – SSF

I love SQL Prompt, and think it’s a great productivity tool. Even before I worked at Red Gate, I lov...

BLOG

From the Labs of SQL Prompt

I love SQL Prompt as an add-in for SSMS. The intellisense is very handy for me and I’ve gotten used....

Tags
quick tips    
sql prompt    
 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones