This topic describes how to manage a database, such as querying or updating data in the database, on the SQL Console page in the Data Management Service (DMS) console.

Prerequisites

You have the permissions to query, modify, and export data in a database. For more information, see Manage permissions.

Go to the SQL Console page

  1. Log on to the DMS console.
  2. In the left-side navigation pane, enter the name of the target database in the search box and press Enter. From the matched result, click the instance where the target database resides and double-click the target database. The SQL Console page appears.
    Go to the SQL Console page

Query data

  1. Go to the SQL Console page.
  2. On the SQLConsole tab, enter an SQL query statement in the SQL editor and click Execute on the top of the SQL editor.
    Enter an SQL query statement
    Note
    • Each query result set is displayed on an Execution History tab below the SQL editor. You can double-click an element in the query result set and modify the element as needed.Modify a query result set
    • You can double-click the name of a table in the navigation tree on the left of the SQL editor. An SQL statement for querying data in the table is automatically entered in the SQL editor.Automatically generate an SQL statement for querying data in a table
    • The Execution History tab below the SQL editor displays all historical SQL statements that were executed. You can double-click a historical SQL statement to copy the SQL statement to the SQL editor.Copy a historical SQL statement

Update data

  1. Go to the SQL Console page.
  2. On the SQLConsole tab, enter an SQL update statement in the SQL editor and click Execute on the top of the SQL editor.
  3. In the Execution Confirmation message, click OK.
    An SQL update statement

Manage frequently used SQL statements

  1. Go to the SQL Console page.
  2. On the SQLConsole tab, enter an SQL statement in the SQL editor and select the entire statement.
  3. Move the pointer over Saved SQL and select Add.
    Add an SQL statement to Saved SQL
  4. In the Add to Saved SQL dialog box, enter a name for the SQL statement in the Title field, set the Scope parameter, and then click OK.
    Configure a saved SQL statement
  5. To insert a saved SQL statement to the SQL editor, move the pointer over Saved SQL and then select the target SQL statement. The SQL statement is automatically inserted to the SQL editor.
    Insert a saved SQL statement

View data in the form of a visual table

  1. Go to the SQL Console page.
  2. In the navigation tree on the left of the SQL editor, right-click the target table and select Open Table.
    View a table
  3. On the Table tab, view the data in the target table in the form of a visual table.
    View data in the form of a visual table
  4. On the Select Columns tab on the right, select one or more columns that you want to view and click OK in the lower part of the tab. The Table tab will display only the selected columns.
    Select one or more columns to be displayed