---
cuppy_hub: salesforce
cuppy_path: reference/official/data360/data-cloud-query-guide/references/dc-sql-reference/create-external-table.md
cuppy_section: docs
cuppy_doc: 86BC-3H5C
cuppy_doc_uuid: ba8a1820-5e8d-43f4-b36d-b15e4e52ed20
cuppy_permalink: https://cuppy.io/salesforce/d/86BC-3H5C
cuppy_version: 1
cuppy_updated: 2026-10-23T16:16:52.575Z
cuppy_canonical: https://cuppy.io/salesforce/docs/reference/official/data360/data-cloud-query-guide/references/dc-sql-reference/create-external-table
cuppy_mcp: https://cuppy.io/mcp
cuppy_body_sha256: 58f6840f15832522fecbb1005e543541857ce9df3d3b94e7ba823d9e0228c3c3
# cuppy_body_sha256 is over the document body ALONE, excluding both generated blocks.
---

> Mirror of <https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/create-external-table.html> (Salesforce, Data 360 Query Guide), read 2026-10-23. Salesforce's own page is the authority; this copy exists because that site refuses non-browser readers.

## CREATE EXTERNAL TABLE

**Applies to:** ❌ Data 360 SQL ✅ Tableau Hyper API

Define a new external table.

where `column_def` is:

and `option` can be one of:

`CREATE TEMPORARY EXTERNAL TABLE` will create a new temporary external table, enabling to refer to external data from `<source_location>` in a SQL query as if it was stored in a Hyper table named `<table_name>`. However, no data will be stored in Hyper. Instead, Hyper will read from the external source whenever the external table is accessed in a query. See [External formats](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/external-formats.html) for a list of supported external formats. It is mandatory to use the `TEMP` or `TEMPORARY` keyword, as only temporary external tables are supported.

The schema of the external source can be given explicitly through `<column_def>`, or it can be omitted, in which case Hyper will infer the schema from the file. This only works for certain file formats that carry schema information; refer to [???](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/external-formats.html) for details about which file formats support schema inference.

`TEMPORARY` or `TEMP`
Temporary external tables are automatically dropped at the end of a session and are only visible to this connection. Existing permanent tables with the same name are not visible to the current session while the temporary table exists, unless they are referenced with schema-qualified names. It is mandatory to use the `TEMP` or `TEMPORARY` keyword, as only temporary external tables are supported.

`IF NOT EXISTS`
Do not throw an error if a table with the same name already exists. Note that there is no guarantee that the existing table is anything like the one that would have been created.

`<table_name>`
The name of the external table to be created.

`<column_name>`
The name of a column to be created in the new external table.

`<data_type>`
The data type of the column. For more information on the data types supported by Hyper, refer to [???](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/datatypes.html).

`COLLATE collation`
The `COLLATE` clause assigns a collation to the column (which must be of a collatable data type). If not specified, the column data type's default collation is used.

`NOT NULL`
The column is not allowed to contain null values.

`NULL`
The column is allowed to contain null values. This is the default. This clause is only provided for compatibility with non-standard SQL databases. Its use is discouraged in new applications.

`<source_location>`
Location to read the data from. See [External Location](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/external-location.html) documentation for more information.

`FORMAT => format_name`
Selects the data format to be read. This option can be omitted in case the format can be inferred from the file extension. In case of a list of sources, all of them need to share this extension. Supported formats are depicted in detail in [External formats](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/external-formats.html).

`format_specific_option => value`
A format-specific option. The available options for each respective format can be found in [External formats](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/external-formats.html).

Create a temporary external table for a local CSV file in the working directory of the Hyper server, having two columns and a custom delimiter. Then, querying the data in this external table:

Same but reading from multiple CSV files:

Create a temporary external table for an Apache Parquet file from Amazon S3 using empty credentials and inferring the bucket region. The schema of the file is inferred from the schema information in the file. The file format is inferred from the file extension:

Same but with explicit Amazon S3 credentials and bucket region:

Using an external table in a SQL query is functionally equivalent to calling the [`external`](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/external.html) function. Furthermore, the [COPY FROM](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/copy-from.html) statement can be used to directly import data from an external file into a native Hyper file.

For a discussion of the pros and cons of the various alternatives, see [Reading External Data in SQL](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/external-syntax.html).


---
<!-- cuppy -->
You are reading one file. The same content is free over MCP at https://cuppy.io/mcp with no signup: ranked search across all 376 documents in this hub, the merged view when you work in a layer, known workarounds matched to the error you hit, and depth control so you spend tokens on what you need. Start with the `_hello` tool. How to connect: https://cuppy.io/salesforce/ Something wrong in this document? Report it with the `session feedback` tool on the same endpoint.
<!-- /cuppy -->
