SQL Editor overview

When working with databases, a crucial aspect of user interaction involves writing and executing SQL queries. In SQL Editor, they can create and manage SQL documents and subsequently execute them against the connected database server.

To create a new SQL document:

1. On the standard toolbar, click New SQL.

2. In the Connect to Server window that opens, choose the server you want to connect to or create a new one, and click Connect.

The empty SQL document opens where you can create or update a SQL statement.

SQL document overview

Each SQL document includes different representations of the content: Text and Data document views.

  • Text view comprises the SQL Editor, which allows you to write SQL statements.
  • Data view, typically shown after a query is executed, comprises the Data Editor that displays the results set returned by a database server.

Document views

To switch to a specific view, click the view name at the bottom panel of the document.

Represent query execution results

In the SQL Editor, the query execution results can be represented as a grid (default state) and as cards.

Grid View

To represent results as a grid, click Switch to Grid View on the SQL Editor toolbar.

Query execution results in grid format

In the grid view, you can group the execution results by box. To do this, click Show Group by Box and drag a column header to the corresponding area:

Results as Grid: Group by Box

The query execution results will look as follows:

Results as Grid: Group by Box - Result

Card View

To view the results as cards, click Switch to Card View on the SQL Editor toolbar.

Results as Cards

Document layout

SQL document has two types of view layout: Split Layout (default layout) and Combined Layout. To switch between document layouts, use the corresponding options at the bottom-right corner of the document.

Split layout

In the split layout, a document is divided into two horizontal areas:

1. Text - the SQL document you are working with.

2. Data - the query execution result.

A document has the main view, which is aligned to the top of the document viewport, and additional views, which are displayed at the bottom area of the document view.

To change the main document view, click Swap Layouts Swap main and additional document views at the bottom of the SQL document.

Split Layout

Combined layout

In the combined layout, you can see only one view at a time.

Combined Layout

To switch between the document views, click Text or Data at the bottom of the SQL document.

Text selection

SQL code can be selected in the following ways:

  • Use SHIFT + navigational keys, PAGE UP, PAGE DOWN, HOME, and END.
  • Use SHIFT + ALT + navigational keys, PAGE UP, PAGE DOWN, HOME, and END.
  • Use the mouse.

Bookmarks

dbForge Data Compare allows adding a bookmark to any part of a SQL document. This feature saves a particular line in the code and the cursor position.

To add a bookmark, on the standard toolbar, click Toggle a bookmark on the current line or press Ctrl+K, K.

To navigate the bookmarks:

  • Click Previous Bookmark Move the caret to the previous bookmark or use the Ctrl+K, Ctrl+P keyboard shortcut.
  • Click Next Bookmarks Move the caret to the next bookmark or use the Ctrl+K, Ctrl+N keyboard shortcut.

To delete bookmarks in the current document, click Clear Bookmarks Clear all bookmarks in the current document or press Ctrl+K, L.

Bookmarks

Code folding

If you are working with a large script, you might need to collapse some of the clauses for convenience. Hovering over the collapsed clause will display its content.

Code Folding

Status bar

The status bar contains the most important information regarding the current connection and query execution.

Status Bar

Environment Category Connection Status Host (Server version) Username Selected Database

When you execute a query, the query execution status and the query execution time will be displayed in the status bar.

Status Bar Query Executed

Environment Category Query Execution Status Execution Time Host (Server version) Username Selected Database

Comment the code

To comment on the part of the SQL code, select it and click Comment icon Comment out the selected lines on the standard toolbar. Alternatively, press CTRL+K, C. To uncomment a section, select it and click Uncomment icon Uncomment the selected lines on the standard toolbar or use the CTRL+K, U keyboard shortcut.

Comment

Want to Find out More?

Overview

Overview

Take a quick tour to learn all about the key benefits delivered by dbForge Data Compare for SQL Server.
All Features

All features

Get acquainted with the rich features and capabilities of the Data Compare in less than 5 minutes.
Request a demo

Request a demo

If you consider employing the Data Compare for your business, request a demo to see it in action.
Ready to start using dbForge Data Compare for SQL Server?