In this Super SQL Tip Redgater Jamie Wallis explains how you can easily customize your code completion suggestions to pop-up less frequently or on demand.
SQL Prompt is a code completion, code formatting, and refactoring tool for SQL Server. It’ll plug into SQL Server Management Studio or Visual Studio. You’ll find you can work more quickly and accurately with SQL queries, as well as standardize across your team by sharing formatting styles and commonly used SQL snippets. Try it free for 28 days at www.red-gate.com/sqlprompt
For more tips for writing SQL effortlessly check out the #SuperSQLTips playlist: www.youtube.com/playlist?list=PLhFdCK734P8A_q6XHDXi4CQzys3R0Jw3X
Hi, I’m Jamie Wallis from Redgate Software and I’ve got another Super SQL Tip for you.
Today I want to show you how you can customize the way SQL Prompt suggestions appear when you are coding.
By default, SQL Prompt shows you the auto-completion box whilst you type, whenever it thinks it can make a useful suggestions for your code.
So let me just open a new query in SSMS and when start typing you can see these helpful suggestions appear. This helps complete my code quickly and without errors.
Whilst this is very useful, there may be times you don’t want these suggestions appearing continuously, particularly if you are working through something quite intricate.
Rather than turning off suggestions completely, the best way to manage suggestions is to limit when they appear or to make them appear on demand.
To edit how suggestions appear go to the SQL Prompt menu and open Options.
You’ll see the Suggestions section here has settings for Behaviour, so go here and where it says “Automatically show suggestions after” simply change this number to something that will allow you to type without interruption. I’m going to go for 5000 milliseconds, and click OK.
So this means that I can type continuously without interruption, but if I want SQL Prompt to give me suggestions then all I need to do is pause typing for 5 seconds and I’ll get the box pop up as normal.
Alternatively you can change the settings to only show suggestions on demand.
Go back into the Options menu.
Keep “Show code completion suggestions” ticked, but untick “Automatically show suggestions”.
Then when you write your code you can do so without interruptions, BUT if you do want a suggestion all you need to do is press Ctrl and SPACE to show the SQL Prompt box.
It’s that easy!
I hope you find this quick tip helpful.
I’m Jamie Wallis from Redgate Software, thanks for watching.