SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Query Databases Using the SQL Console in SAP HANA Cloud Central

Learn how the SQL console can be used within SAP HANA Cloud Central to quickly query a selected database.

Overview

🎓 beginner 10 min. SAP HANA CloudBeginnerSAP HANA Cloud SAP HANA DatabaseSAP HANA Cloud Data Lake

You will learn

  • โœ”How to open a SQL console, specify the credentials, and set the current schema
  • โœ”An overview of the functionality provided in the SQL console
MICHELLE WANG M MICHELLE WANG August 13, 2026
Created by August 12, 2026
Contributors

Prerequisites

Prerequisites

  • An SAP HANA Cloud database
  • You have completed this tutorial which creates a database schema for an SAP HANA Cloud, SAP HANA database.
  • You have completed this tutorial which creates a database schema for an SAP HANA Cloud, data lake Relational Engine

Steps

Step 1 Open a SQL console
โ€”

This step demonstrates how a SQL console can quickly be opened from within SAP HANA Cloud Central and how to change the SQL console’s credentials and schema.

  1. In SAP HANA Cloud Central open a SQL console by selecting SQL Console in the left pane. Notice that the SQL console is not associated with a database when opened in this way.

    open SQL console
    open SQL console

    Additional SQL consoles can also be opened by selecting the + icon.

  2. This time select Instances, select a database, and choose Open SQL Console from the actions menu.

    open SQL console from an instance
    open SQL console from an instance

    Notice that it is now connected to the instance named HC_HDB as shown by the name of the tab and the connection label or through the below SQL.

    SQL
    SELECT CURRENT_USER FROM DUMMY;

    SQL console connected to HC_HDB
    SQL console connected to HC_HDB

  3. There are several ways to connect to a database as a different user:

    • From the Instances list: Click the three dots next to the instance and select Sign in with Different User. Enter the username and password of the desired user after clicking the “Sign in with a different user” option in the confirmation dialog.

      Change Credentials in Instances
      Change Credentials in Instances

    • From the SQL console Connect menu: Select the Connect to link, click the Connect … button, and provide the new username and password.

      Change credentials
      Change credentials

      The Enter Credentials dialog will then ask for the new credentials to be used.

      change credentials
      change credentials

    • Using SQL: Run the CONNECT statement to switch users within the current console session.

      SQL
      CONNECT USER1 PASSWORD Password1;
      SELECT CURRENT_USER FROM DUMMY;

      Change credentials using SQL
      Change credentials using SQL

      The SQL to view the current user for a data lake Relational Engine is shown below.

      SQL
      SELECT CURRENT USER;

      Show current user for a data lake Relational Engine
      Show current user for a data lake Relational Engine

    The Connect menu and SQL CONNECT statement are session-scoped โ€” after a disconnect and reconnect, the console reverts to the credentials it was originally opened with.

  4. If you need to alter the credentials for a database user, there are two ways to do this:

    • Using the SQL console: Run the following statement, replacing the placeholders with the target username and new password.

      SQL
      ALTER USER <user_name> PASSWORD <new_password>;
    • Using the SAP HANA Cloud Central UI: Open the instance, go to the Overview tab, and scroll down to User and Authorization Management. Select Users, click on the user you want to update, and choose Edit to make your changes.

    Changing User Credentials Using HCC UI
    Changing User Credentials Using HCC UI

  5. The current schema can be set and viewed for a SAP HANA database using the SQL statements below or by clicking on the Current Schema link.

    SQL
    SET SCHEMA HOTELS;
    SELECT CURRENT_SCHEMA, CURRENT_USER FROM DUMMY;

    Set the schema
    Set the schema

    For data lake Relational Engine instances, the current schema can be set and viewed as shown below.

    SQL
    SET SCHEMA HOTELS;
    SELECT CURRENT SCHEMA, CURRENT USER;

    set the schema of a data lake RE
    set the schema of a data lake RE

Step 2 Execute SQL
+
Step 3 Statement library
+
Step 4 GenAI in the SQL console
+
Step 5 Knowledge check
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 5
1. Open a SQL console 2. Execute SQL 3. Statement library 4. GenAI in the SQL console 5. Knowledge check

Learn more →