SQL Editor

When you interact with MS SQL Server databases, you mostly do it by writing, editing, and executing SQL queries, statements, stored procedures, and scripts. A good SQL editor will help with database interaction by providing syntax highlighting, robust code completion functionality, the ability to get information about function parameters, and other features that make your coding experience more efficient.

SQL editor for dbForge Studio for SQL Server was designed with all these things in mind to satisfy both professional developers and beginners. We tried to create an editor that will optimize and streamline your work with SQL documents and, most importantly, save your time in the process.

In this article, we will take a closer look at each method and determine the differences between them.

Colorized Statements

In SQL Editor, statements are highlighted in blue so you can easily distinguish them from the rest of the code and quickly edit them as needed. This feature greatly increases code readability and general work efficiency.

Visual SQL Editor - Colorized Statements

Context-sensitive code completion

This visual SQL editor tool extracts context-sensitive features from the code and their relations to other code elements and auto-completes the current code with proper elements according to the chosen pattern.

Visual SQL Editor - Code Completion

Code collapsing/expanding with support of user-defined regions

Whenever you have a block of code (BEGIN....END, etc), SQL editor will put a little plus sign in the margin and allow you to "collapse" that block of code so that you only see the BEGIN part, while the rest of the block is hidden. If you're working with a really large set of code, this feature can bring an additional level of organization and convenience.

In addition, SQL Code Editor allows you to collapse and expand named regions that can simplify the navigation through the code.

Visual SQL Editor - Expand and Collapse Code

SQL formatting with rich options

Improve readability, consistency, and standardization with SQL formatting. This feature allows you to easily define and share SQL coding standards among multiple developers. Our SQL code editor tool includes a wide choice of options for code formatting. Based on your needs, you can use three types of formatting:

  • Automatic code formatting. This significantly saves your time. By default, when you finish a statement with a delimiter, it is automatically formatted.
  • Manual code formatting. In case you want to format SQL code manually, decide whether you want to format all code in your script or only a specified statement.
  • SQL formatter wizard. With its help, you can format multiple SQL files at once.
Visual SQL Editor - SQL Formatting

SQL snippets library with a browser window and editor

Code snippets are meant to help you type SQL code more quickly. You can use predefined snippets provided in the application and/or create your own to later insert them into SQL scripts and queries. Each snippet represents a statement or a group of statements fulfilling the same task, such as creating a new user or describing a package. You can insert the required code snippet into your source code in a few clicks.

Visual SQL Editor - SQL Snippets

Document Outline for quick navigation through large scripts

This window provides quick and easy navigation through report elements. It can be used while building a report to access all its elements and to see the report's overall structure.

Visual SQL Editor - Document Outline

One-step access to the schema object editor from code (go to definition)

This option allows you to open the Visual Object Editor and explore DDL objects and their properties. If the definition is located outside of the current script, an object editor or a corresponding DDL script will open in another window. You will appreciate this feature even more while working with SQL scripts in a database project. A project can contain SQL scripts and query files located in different folders and on different disks, but thanks to the Go to definition option, you can still navigate to the definitions of database objects from the scripts where these objects are mentioned.

Visual SQL Editor - Go to Definition Option

Parameter information for stored procedures and functions

This feature helps you quickly see the names and types of parameters used in a function or a stored procedure script. All information is neatly displayed in the Parameter Info tooltip. The parameter displayed in bold type is the next parameter required for the current function or stored procedure.

Visual SQL Editor - Parameter Information

Quick information about schema objects

The Quick Info feature is a tooltip with brief information about database objects, parameters, and variables. The tooltip appears when you place the mouse pointer on the required item in the SQL script or use Ctrl+K and then press I. In case of database objects, the tooltip shows their location and types. You will find this option useful while working with large scripts.

Visual SQL Editor - Quick Info Feature

Executed SQL history window for the document

SQL statement history is designed to ease recalling and re-executing statements you have previously executed. Choose View SQL history from the SQL menu to bring up a dialog where you can choose which SQL statement must be inserted into the editor instead of the current one. Point to a statement in history to view its full text in a hint.

Visual SQL Editor - SQL history