I often find myself working on large legacy systems that employ poor, or in most cases, no naming conventions or consistent coding standards.
The ability to refactor code is one of the most valuable features of any toolset. The nice folks at Redgate have an excellent walkthrough here: I mentioned SSMS templates earlier and want to note that you also have the ability to use those template parameters in SQL Prompt snippets. The ability to create snippets is really useful for repetitive tasks, but before you reinvent the wheel, be sure to check out Gaurav Vohra’s repository of useful snippets on Git: Alasdair Daw has a wonderful article here that examines the subtleties in this great feature:
You also have the ability to create custom placeholders which are basically free text fields. To get a feel for how they are structured, simply open up the snippet manager and look over the definitions of existing snippets. Built in placeholders are reserved words that are variables for specific pieces of information or they represent actions that can be applied to your snippet. It’s easy to highlight an existing query and turn it into a snippet using placeholders. They are many snippets already built into SQL Prompt and activating a snippet is as easy as typing the snippet definition like “st100” to select the top 100 rows from a table as shown below: SQL Prompt takes this concept further by implementing the code snippet library. SSMS has supported templates for several versions that allow you to reuse boilerplate scripts to easily create objects in your databases. Properly formatted SQL is easier to maintain, and SQL Prompt allows you to have a lot of control over how you prefer the formatting to work. Just highlight the SQL and right click to make your query look great! While we’re working with this query, I also want to show you how easily you can change the format. Placing the cursor at the end of the * allows you to hit tab and expand the column list as seen below:įrom there, I can easily edit the column list and save tons of time when dealing with tables that have a large number of columns often used in queries.
I started the example query using the * wild card for columns so I could show you one of my favorite features. I love the way suggestions work, and you can filter that behavior using the drop down list at the bottom of the first popup in the figure above. As you can see in the figure below, there is adequately more information present in the SQL Prompt pop ups. This feature is a vast improvement over the out of the box experience you get with SSMS and VS.
Major features provided by SQL Prompt are:
I’m working with version 7 of SQL Prompt which can be downloaded for a free 28 day trial here: I love tools that save me and my team time which ultimately translates to saving money for my employer and I’ll proceed to show you how SQL Prompt can do that for you. I’m also a fan of Redgate’s tools and today I’d like to share some of the love I have for SQL Prompt. I work as a lead information architect on a large government health care services integration project and you might say I live in SQL Server Management Studio (SSMS) and Visual Studio (VS) during my work hours.