# How Do Salesforce Types Map to Database Column Types?

The following table describes how Salesforce column data types are mapped to database data types:

| Salesforce Type            | H2        | MySQL                         | Oracle(see notes) | PostgreSQL | SQL/Server    |
| -------------------------- | --------- | ----------------------------- | ----------------- | ---------- | ------------- |
| ANYTYPE                    | CLOB      | TEXT                          | NCLOB             | TEXT       | NVARCHAR(MAX) |
| BASE64                     | CLOB      | TEXT, MEDIUMTEXT, or LONGTEXT | CLOB              | TEXT       | VARCHAR(MAX)  |
| BOOLEAN                    | BOOLEAN   | BOOLEAN                       | DECIMAL(1)        | BOOLEAN    | BIT           |
| COMBOBOX                   | NVARCHAR  | VARCHAR                       | NVARCHAR2         | VARCHAR    | NVARCHAR      |
| CURRENCY                   | DECIMAL   | DECIMAL                       | NUMBER            | NUMERIC    | DECIMAL       |
| DATACATEGORYGROUPREFERENCE | CHAR      | CHAR                          | CHAR              | CHAR       | CHAR          |
| DATE                       | TIMESTAMP | DATE                          | DATE              | DATE       | DATE          |
| DATETIME                   | TIMESTAMP | DATETIME                      | TIMESTAMP(3)      | TIMESTAMP  | DATETIME      |
| DOUBLE                     | DECIMAL   | DECIMAL                       | NUMBER            | NUMERIC    | DECIMAL       |
| EMAIL                      | NVARCHAR  | VARCHAR                       | NVARCHAR2         | VARCHAR    | NVARCHAR      |
| ENCRYPTEDSTRING            | NVARCHAR  | VARCHAR                       | NVARCHAR2         | VARCHAR    | NVARCHAR      |
| ID                         | CHAR      | CHAR                          | CHAR              | CHAR       | CHAR          |
| INT                        | INTEGER   | INTEGER, DECIMAL, or BIGINT   | NUMBER            | INTEGER    | INT or BIGINT |
| MULTIPICKLIST              | NVARCHAR  | VARCHAR                       | NVARCHAR2         | VARCHAR    | NVARCHAR      |
| PERCENT                    | DECIMAL   | DECIMAL                       | NUMBER            | NUMERIC    | DECIMAL       |
| PHONE                      | NVARCHAR  | VARCHAR                       | NVARCHAR2         | VARCHAR    | NVARCHAR      |
| PICKLIST                   | NVARCHAR  | VARCHAR                       | NVARCHAR2         | VARCHAR    | NVARCHAR      |
| REFERENCE                  | CHAR      | CHAR                          | CHAR              | CHAR       | CHAR          |
| STRING                     | NVARCHAR  | VARCHAR                       | NVARCHAR2         | VARCHAR    | NVARCHAR      |
| TEXTAREA                   | NVARCHAR  | VARCHAR                       | NVARCHAR2         | VARCHAR    | NVARCHAR      |
| TIME                       | TIME      | DATETIME                      | TIMESTAMP(3)      | TIME       | DATETIME      |
| URL                        | NVARCHAR  | VARCHAR                       | NVARCHAR2         | VARCHAR    | NVARCHAR      |

## Notes

* The compound type ADDRESS is ignored but its data is picked up in component fields.
* The compound type LOCATION is ignored but its data is picked up in its component Latitude and Longitude fields.
* If the length of any string type column exceeds the “Maximum Varchar” parameter then its data type will be the same as used for BASE64 types.

For Oracle Only:

* CopyStorm can be forced to use a VARCHAR2 rather than NVARCHAR2 by unchecking the “Use NVARCHAR2” option in the *Advanced Database Options* on the *Advanced* tab. When CopyStorm creates or modifies a column it chooses a VARCHAR2 or NVARCHAR2 Oracle data type based on the current setting of the “Use NVARCHAR2” option. Note: CopyStorm will not change the data type of an existing column unless the column’s length increases in Salesforce.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learn.capstorm.com/frequently-asked-questions/how-does-copystorm-work/how-do-salesforce-types-map-to-database-column-types.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
