> AI agents: this is one page from Mammoth Analytics documentation. The index of all pages as Markdown is https://docs.mammoth.io/llms.txt. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get Markdown.

# SAP HANA connector

> Connect Mammoth to SAP HANA: required credentials, port guidance, how to create a connection, and how to import a table or SQL query as a dataset.

The SAP HANA connector imports data from your SAP HANA database into Mammoth as a dataset. Browse tables directly or write custom SQL queries, with AI-assisted query generation from a plain-language description when it is enabled for your workspace.

## Before you start

You need:

- An SAP HANA instance reachable from the internet
- A HANA user with `SELECT` access to the schemas and tables you want to import
- Your HANA server's **Host URL**, **Port**, **Username**, **Password**, and **Database** name
- Mammoth's IP address added to your HANA instance's allowed inbound list—see [Network requirements](https://docs.mammoth.io/learn/connectors/network-requirements/)

> **Tip: Confirm your port with your HANA administrator.**
> The connection form pre-fills **Port** with `443`, but that's a generic default, not a HANA-specific one. Many on-premises SAP HANA instances listen on a port in the `3<instance number>15` range instead (for example, `30015` for instance `00`). Ask your HANA administrator for the correct port rather than assuming `443` will work.

## Step 1: Select the SAP HANA connector

1. In Mammoth, go to **Data Library** and click **+ New Dataset**
2. Select **Connectors**
3. Search for **SAP HANA** or find it in the **Databases** category
4. Click the **SAP HANA** tile

## Step 2: Create a connection

Click **New Connection** to open the credential form.

| Field | Description | Example |
| --- | --- | --- |
| **Host URL** | Hostname or IP address of your SAP HANA server | `hana-prod.example.com` |
| **Port** | TCP port your HANA instance listens on | Confirm with your HANA admin—see tip above |
| **Username** | HANA user with `SELECT` access | `MAMMOTH_READER` |
| **Password** | Password for the HANA user |—|
| **Database** | Name of the HANA database to connect to | `PROD` |
| **Display Name** | Optional label for this connection in Mammoth | `HANA Production` |

A callout below the fields reminds you to whitelist Mammoth's IP address in your database settings—see [Network requirements](https://docs.mammoth.io/learn/connectors/network-requirements/) for the exact address to use.

After filling in the fields, click **Connect**. Mammoth validates the credentials and saves the connection; if validation fails, the error message appears at the bottom of the form.

## Step 3: Select a SAP HANA profile and query your data

Once connected, select the connection under **Existing Connections**. Mammoth lists the schemas in your HANA database as **Profile** entries. Click a profile to browse the tables in that schema—a profile in this connector corresponds to a HANA schema, even though the list is labeled "Profile" rather than "Schema."

### Browse SAP HANA tables

Click any table in the **List of tables** panel to load a preview query using double-quoted identifiers, HANA style: `SELECT * FROM "schema"."table"`.

### Generate a SAP HANA query with AI

When enabled for your workspace, SAP HANA shows the **Describe the data you need...** AI query box above the query editor. Describe the data you need—for example, *"all orders completed in the last 90 days"*—and click the generate button. The box is disabled while Mammoth sets up metadata for AI query.

### Write a custom SAP HANA query

```sql
SELECT "ORDER_ID", "CUSTOMER_ID", "AMOUNT", "ORDER_DATE"
FROM "SALES"."ORDERS"
WHERE "ORDER_DATE" >= ADD_DAYS(CURRENT_DATE, -90)
  AND "STATUS" = 'COMPLETED'
```

Query validation supports only `SELECT` statements. See [Understanding data preview & query](https://docs.mammoth.io/learn/connectors/understanding-data-preview-query/) for a full guide to the preview screen.

## Step 4: Save the SAP HANA dataset

1. Enter a **dataset name** in the **Save table as** field
2. Check the **Update Method** (the default is **Replace all data**). To change it, click the edit icon, pick an option, and click **Save changes**:
   - **Replace all data**—Replaces all existing data
   - **Add new data**—Adds new data based on a unique sequential column
   - **Replace with new data**—Replaces existing data with new data based on a unique sequential column
   For **Add new data** and **Replace with new data**, also choose a **Key column**—a numeric or date column with incrementing values, such as an ID or a date.
3. Click **Save as dataset**. When the dataset is saved, click **Done**

## Allow Mammoth in your SAP HANA network settings

Add Mammoth's IP address to your SAP HANA instance's allowed inbound connections. See [Network requirements](https://docs.mammoth.io/learn/connectors/network-requirements/) for the current IP address and configuration steps.

## Troubleshoot SAP HANA connections

### Connection fails

- Confirm the port with your HANA administrator—see the tip in [Before you start](#before-you-start)
- Verify Mammoth's IP address is whitelisted in your HANA network settings
- Check the username and password are correct for the target database

### HANA error codes

The message "HANA Error Code {code}: {description}" is passed through directly from the HANA driver. The `{code}` and `{description}` identify the specific HANA-side error (for example, invalid object name or insufficient privileges)—use them to look up the issue in SAP's HANA documentation or check with your HANA administrator.

### No tables appear after selecting a profile

Your HANA user may lack `SELECT` privileges on that schema. Ask your HANA administrator to grant access to the relevant schema and tables.

### Query returns a column ambiguity error

Qualify column names with their table or alias (for example, `"o"."ORDER_ID"` instead of `"ORDER_ID"`) when your query joins multiple tables.

---
Source: https://docs.mammoth.io/learn/connectors/sap-hana-connector.md · Updated: 2026-10-13