Skip to main content
Share / Export

Write, Run, and Save SQL Queries

Use SQL Editor to write or paste Vista SQL, run SELECT / WITH queries, export the grid, and save reusable statements.

Where: Mission Control → SQL StudioSQL Editor
Route: /missioncontrol/sql/sql-editor

Bridge must be online before Run SQL works — see SQL Studio workflow. To discover tables and copy boilerplate first, use Explore Vista schema and generate SQL.


Open a query tab

  1. Open SQL Editor.
  2. If you see No Query Tabs Open, click Create New Query (or select a saved statement from the left SQL Statements sidebar).
  3. Or click New statement (+) in the sidebar header to open a tab titled New Statement.

You can keep up to 10 tabs. Default blank tab title is Untitled Query. Open tabs and drafts restore in this browser; result grids do not.


Write SQL

In the editor pane:

  1. Type or paste a query that starts with SELECT or WITH.
  2. Optional aids:
    • Type @ to open magic-template suggestions (detail label Magic Template). Pick a table to insert a ready SELECT scaffold (alias, optional HQ security join / company / month filters when the schema supports them).
    • Keep Suggestions on for schema-aware completions; turn the switch off to silence them.
    • Click Format (title Format SQL (house style)) to reformat the current text.
    • Click Copy to copy the full editor contents.

Status bar shows Lines, Characters, and Ready (or Executing SQL... while a run is in progress).


Run a query

  1. Leave the editor on a SELECT / WITH statement (or highlight the portion you want to run).
  2. Click Run SQL. With a non-empty selection, the button reads Run Selected. While running it shows Executing....

Only statements that start with SELECT or WITH (after trim) are sent. Other statement types do not run from this toolbar.

On failure, the results pane shows Error and the message; expand Show executed SQL if you need the text that was sent. Toast title: SQL execution failed.


Review and export results

After a successful run, the results pane below the editor shows the grid.

ControlUse
StatusSuccess, No Data, Error, or Executing (plus timing / row count when available)
Search results...Filter rows in the grid
ColumnsShow or hide columns
CSV / EXCELDownload the current (filtered/visible) grid as sql-results.csv or sql-results.xlsx
FullscreenExpand or exit the grid (Enter fullscreen / Exit fullscreen)
PaginationPage through large result sets

Empty grid message: No results to display.


Save and reuse statements

Save

  1. With SQL in the active tab, click Save.
  2. Toast Statement saved confirms it. The statement appears under SQL Statements.

Save creates a new private statement from the current tab. After a tab is linked to a statement, further edits auto-save to that statement after a short idle period.

If the tab has no SQL: toast Nothing to save.

Open

Click a statement card (or its ⋯ menu → Open). A linked tab opens (or focuses) with that SQL.

Manage from the card menu

ActionResult
StarFavorite / unfavorite
RenameEdit the title inline
DuplicateCreates {title} (Copy) and opens it
Add to Favorites / Remove from FavoritesSame as the star
DeleteConfirm permanent delete, then the statement is removed (linked tabs close)

Browse the sidebar

ControlUse
Search statements...Match title, SQL text, or tags
Filter (funnel)All / Favorites / Tags; Sort by Recent, A-Z, or Executions; Clear All Filters
TagsClick a tag chip to filter

Empty list: No statements yet with Create First Statement. Filtered empty: No statements match your filters.


Tabs

ActionHow
SwitchClick a tab
RenameTab ⋯ → Rename Tab
CloseTab × or ⋯ → Close Tab

Closing a tab with unsaved changes prompts Discard unsaved changes?Discard and close or Stay.


Typical sequence

  1. Confirm Bridge is online.
  2. Create New Query (or open a saved statement).
  3. Write or paste SELECT / WITH SQL (optional: @ magic template, Format).
  4. Run SQL (or Run Selected).
  5. Search, adjust Columns, or export CSV / EXCEL.
  6. Save when you want the statement in SQL Statements.