SyncriTab

Writing SQL

You write queries in the SQL editor on the Query tab. It highlights SQL syntax, suggests table and column names as you type, and has the editing tools you'd expect from a code editor.

The SQL editor

The SQL editor fills the top of the Query tab. Its title bar shows the number of the query page you're editing, for example SQL Editor - Page #1. Each query page has its own SQL. See Query Pages, Scripts & Workbooks.

If auto-save is on, what you type is saved as you work, so it's still there after you sign out or your browser closes. See Saved Sessions.

Writing more than one statement

A query page can hold a whole script. To separate statements, put the query terminator on a line by itself between them. The default terminator is go:

SELECT * FROM Customers
go
SELECT * FROM Orders
go

You can change the terminator in Edit › Options. See Options & Preferences. To learn how to run all or part of a script, see Running Queries & Results.

IntelliSense

As you type, IntelliSense suggests the names of tables and columns from the database you're connected to. Choose a suggestion to insert it instead of typing the whole name.

IntelliSense suggesting column names in the SQL editor.
IntelliSense suggestions.

Using suggestions

Next to each name, IntelliSense shows where it comes from: the schema for a table, or the table for a column. This helps when your query uses several tables.

What IntelliSense suggests

Where the cursor isSuggestionsExample (▮ is the cursor)
After FROM, JOIN, UPDATE, or INSERT INTO Tables and views SELECT * FROM ▮
In the column list of a SELECT statement, once it has a FROM clause Columns of the tables in the FROM clause SELECT ▮ FROM Customers
In a WHERE clause, before the = Columns DELETE FROM Orders WHERE ▮
In the SET clause of an UPDATE statement, before the = Columns UPDATE Customers SET ▮
In the column list of an INSERT statement Columns INSERT INTO Customers (▮
After a table name or alias followed by a period, anywhere after the table-name spot Columns of that table only SELECT c.▮ FROM Customers c
After DROP TABLE or DROP PROCEDURE Tables or stored procedures DROP PROCEDURE ▮

A few things to know:

Turning IntelliSense off

If you'd rather type without suggestions, choose Edit › Options, select Disable IntelliSense on the General tab, and click Save. The change takes effect right away.

Commenting out lines

To stop part of a script from running without deleting it, turn it into a comment:

  1. Select the lines. To comment out just one line, click anywhere in it.
  2. Choose Edit › Comment Block. SyncriTab adds -- to the start of each line.

To undo it, select the lines and choose Edit › Uncomment Block, which removes the --.

SELECT * FROM Customers
-- WHERE Country = 'Canada'
-- ORDER BY Name

These commands have no keyboard shortcut by default. To add one, choose Tools › Customize Shortcuts. See Keyboard Shortcuts.

Finding and replacing text

To find text in the current query page, choose Edit › Find or press Ctrl+F. To replace it as well, choose Edit › Replace or press Ctrl+H. On a Mac, use Cmd instead of Ctrl. A search box opens in the upper-right corner of the editor, and every match is highlighted.

The find and replace box in the SQL editor.
Find and replace.

Find and replace work on one query page at a time. To search the database itself for objects by name, use Database Search.