I’ve long been a proponent of using stored procedures in my database projects, and SQL Prompt supports the ability to highlight any block of valid SQL and encapsulate it into a stored procedure. This makes it easier to apply a naming standard to existing tables, views, stored procedures and functions along with their respective column names and parameters. SQL prompt has many amazing refactoring features starting with Smart Rename which allows you to right click and rename objects without breaking dependencies.
I mentioned earlier when showing off the formatting features of SQL Prompt that well formatted code is easier to maintain thus leading to saving time and ultimately money. 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. There 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.
If you’ve never tried it, download SQL Prompt today and see how much faster you can write code.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. This isn’t a big fix, but it is updating some things that changed as MS upgraded part of the shell. Other fixes are on the way, as the teams are scrambling. After this, I restarted SSMS and Prompt now works. I also upgraded SQL Change Automation at the same time. I connected to a database and SQL Prompt is definitely broken.įortunately, Redgate released a fix today, which you can download from
Especially for SQL Prompt.Īs soon I installed this and started SSMS, the fun began. I’d heard reports of major changes in the VS shell causing issues with various add-ins, including Redgate tools, so I decided to verify things.
I downloaded SSMS 18.5, as there were a lot of fixes in here and thought this was a good upgrade to try.