Admin: Corporate Office
Page: Reports > SQL Manager
URL: [CLIENTID].corpadmin.directscale.com/Corporate/Reports/SqlViewer
Permission: SqlManagerAdministrator(), SqlManagerBasic(), or SqlManagerReadOnly()
The SQL Manager is used to improve the standard reporting in Corporate Office. To ensure that your changes will not impact the live database performance, all queries run through the SQL Manager will run off a Replicated Database (the same for fail-overs).
What We’ll Cover
Running a SQL Query
-
In the SQL Query box, type your SQL statement.
For examples of SQL queries, see SQL Query Library
Click the Table Schema link to view a list of all available tables you can click and use in queries.
Tip: Click in the Query Box and press CTRL+SPACE on your keyboard to enable SQL Type-Ahead
-
Click the Run button to view the query.
The query results will display under Query Results.
Table Schema
View a list of all available tables you can click and use in queries.
The query will return up to 300 results.
-
Use the search bar to find a table name, or scroll through the Table Name List.
-
Click a table name to view the table. The view-only results show below the Query Box.
SQL Type-Ahead
Click in the Query Box and press CTRL+SPACE on your keyboard to enable SQL Type-Ahead. SQL Type-Ahead is a Code Mirror implementation that suggests SQL syntax and tables as you type to aid in writing queries.

Saving a SQL Query
-
In the Query Box, run a SQL Query.
-
Click the Save button.
The Save Query pop-up window opens.
-
In the pop-up, type a Query Name.
-
Click Save.
The pop-up closes, and the query saves.
Editing an Existing Saved SQL Query
-
Click the View Saved Queries link.
The Saved Queries pop-up window opens.
-
In the pop-up, select a Query Name.
The Query Box will populate with the saved SQL statement.
-
Make any necessary edits to the query.
-
Note: Typing a new name will save a new query under that name. Leave the name the same to keep the edits to the existing query.
The pop-up will update, asking if you want to overwrite the existing query.
-
Click the Replace button to confirm.
Deleting an Existing Saved SQL Query
-
Click View Saved Queries.
The Saved Queries pop-up window opens.
-
In the pop-up, click the
icon for the query you want to delete.
A Delete Query confirmation pop-up opens.
-
Click the Delete button to confirm.
A success status message appears, and the query deletes.
Exporting a SQL Query
After running a query, you can export the results:
-
Click the Export button.
A CSV file downloads. You can open this file in any spreadsheet program (such as Microsoft Excel or Google Sheets).
Comments
0 comments
Please sign in to leave a comment.