Blog Post

SQL Prompt Quick Access to Helper Code


We’ve been doing some events as part of the Redgate Roadshow, and at one of the events, we had a customer ask about something that we demo’d. This post looks at quick access to snippets.

This is part of a series on SQL Prompt that I’ve written. If you’ve never tried SQL Prompt, it’s amazing. Download an eval today.

The Command Palette from the Query Editor

When typing a query in SSMS, I can hit the CTRL button and get the palette on the side. Here’s a basic query:

2023-09-04 04_39_35-SQLQuery3.sql - ..dlm_1_dev (WAY0UTWESTHP_way0u (89))_ - Microsoft SQL Server Ma_thumb[1]

I might want to add the begin and end around my code in the proc. If I highlight some code and hit CTLR, I see this:

2023-09-04 04_40_25-SQLQuery3.sql - ..dlm_1_dev (WAY0UTWESTHP_way0u (89))_ - Microsoft SQL Server Ma_thumb[1]

On the left, I have opened the palette where I can down arrow to pick something relevant or search for a command that helps me. As you can see, the first one is the very common “add begin end” to the code. If I pick this, it will surround my code with begin end, as seen here:

2023-09-04 04_43_07-SQLQuery3.sql - ..dlm_1_dev (WAY0UTWESTHP_way0u (89))_ - Microsoft SQL Server Ma_thumb[1]

I can also get other helper code, like the CTE outline, as you can see below:

2023-09-25 15_16_58-SQLQuery14.sql - ARISTOTLE.sandbox (ARISTOTLE_Steve (75))_ - Microsoft SQL Serve

SQL Prompt is amazing, as this video shows. Download an eval today.

Original post (opens in new tab)
View comments in original post (opens in new tab)


You rated this post out of 5. Change rating




You rated this post out of 5. Change rating