Code completion, formatting, and refactoring with SQL Prompt HD

25.08.2016
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 Transcript: Introduction: 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 can rely on SQL Prompt for speed and accuracy, and save yourself time writing and exploring SQL, so you can focus on the important stuff. We’ve found it can speed up SQL coding by 52%. SQL Prompt has a host of features you’ll find useful everyday – from customizable snippets for the code you use most, which you can share with your team, to tab coloring, so you don’t execute code in the wrong environment. You can work super-fast with data from the Results grid – exporting them straight to Excel, or even scripting them out as an INSERT statement. Let’s jump into SQL Prompt and see these features in action. Code completion: By simply typing J, SQL Prompt autocompletes JOIN, gives you table suggestions, and JOIN conditions, so you don’t have to memorize column names or aliases. We’ve got a SELECT * here: SQL Prompt expands the wildcard so you can keep just the columns you need. Or, use the Column Picker, and hit Tab. These tooltips give you hints about keyboard shortcuts too. We’re using an alias here. SQL Prompt lets you easily rename an alias or variable – it’ll rename every alias in the script, which is great if you’re doing a bit of refactoring. Just right click, or hit F2. Hit Shift+F5 and SQL Prompt will execute just the statement under your cursor. And that tip about working with data in the Results grid? Just right click here, and choose to Export to Excel, copy as an IN clause, or script as an INSERT statement. Code formatting: Here’s how to format your code to your preferred style. Say you’ve got an organizational standard, but you want to code in your own style first. Go to Options, and under Format you’ll find a variety of settings including casing and commas. See the changes in the sample window, and save or export your settings to share with your colleagues. In the query window, just hit CTRL+K+Y to format your code. We’ve got new formatting options coming soon, too, so keep an eye out! Code snippets: Another handy feature in SQL Prompt is snippets, which save you time with repeat blocks of code. Type SSF then hit Tab and you’ll see SQL Prompt inserts SELECT * FROM. This is just one of many built-in snippets. You can easily customize these or create your own. Open the Snippet Manager and click New. Give your snippet a name, insert your code, and save. Now it’s ready for you to use. Or, you can access snippets from the Actions List, as well as comment out code, or surround

Похожие видео

Показать еще