Skip to content

Commit 3f7ee90

Browse files
authored
Merge pull request #115320 from Kat-Campise/sql_articles_4
sql articles 4
2 parents a3dec93 + 45223a5 commit 3f7ee90

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

articles/synapse-analytics/sql/develop-tables-external-tables.md

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,25 @@ ms.reviewer: jrasnick
1515

1616
An external table points to data located in Hadoop, Azure Storage blob, or Azure Data Lake Storage. External tables are used to read data from files or write data to files in Azure Storage. With Synapse SQL, you can use external tables to read and write data to SQL pool or SQL on-demand (preview).
1717

18-
## External tables in Synapse SQL
18+
## External tables in Synapse SQL pool and on-demand
1919

20-
### [SQL pool](#tab/sql-pool)
20+
### [SQL pool](#tab/sql-pool)
2121

2222
In SQL pool, you can use an external table to:
2323

2424
- Query Azure Blob Storage and Azure Data Lake Gen2 with Transact-SQL statements.
2525
- Import and store data from Azure Blob Storage and Azure Data Lake Storage into SQL pool.
2626

27-
When used in conjunction with the [CREATE TABLE AS SELECT](../sql-data-warehouse/sql-data-warehouse-develop-ctas.md?toc=/azure/synapse-analytics/toc.json&bc=/azure/synapse-analytics/breadcrumb/toc.json) statement, selecting from an external table imports data into a table within the SQL pool. In additional to the [COPY statement](/sql/t-sql/statements/copy-into-transact-sql?toc=/azure/synapse-analytics/toc.json&bc=/azure/synapse-analytics/breadcrumb/toc.json&view=azure-sqldw-latest), external tables are useful for loading data. For a loading tutorial, see [Use PolyBase to load data from Azure Blob Storage](../sql-data-warehouse/load-data-from-azure-blob-storage-using-polybase.md?toc=/azure/synapse-analytics/toc.json&bc=/azure/synapse-analytics/breadcrumb/toc.json).
27+
When used in conjunction with the [CREATE TABLE AS SELECT](../sql-data-warehouse/sql-data-warehouse-develop-ctas.md?toc=/azure/synapse-analytics/toc.json&bc=/azure/synapse-analytics/breadcrumb/toc.json) statement, selecting from an external table imports data into a table within the SQL pool. In addition to the [COPY statement](/sql/t-sql/statements/copy-into-transact-sql?toc=/azure/synapse-analytics/toc.json&bc=/azure/synapse-analytics/breadcrumb/toc.json&view=azure-sqldw-latest), external tables are useful for loading data.
2828

29-
### [SQL on-demand](#tab/sql-ondemand)
29+
For a loading tutorial, see [Use PolyBase to load data from Azure Blob Storage](../sql-data-warehouse/load-data-from-azure-blob-storage-using-polybase.md?toc=/azure/synapse-analytics/toc.json&bc=/azure/synapse-analytics/breadcrumb/toc.json).
30+
31+
### [SQL on-demand](#tab/sql-on-demand)
3032

3133
For SQL on-demand, you'll use an external table to:
3234

3335
- Query data in Azure Blob Storage or Azure Data Lake Storage with Transact-SQL statements
34-
- Store SQL on-demand query results to files in Azure Blob Storage or Azure Data Lake Storage using [CETAS](develop-tables-cetas.md).
36+
- Store SQL on-demand query results to files in Azure Blob Storage or Azure Data Lake Storage using [CETAS](develop-tables-cetas.md)
3537

3638
You can create external tables using SQL on-demand via the following steps:
3739

@@ -45,8 +47,8 @@ You can create external tables using SQL on-demand via the following steps:
4547

4648
User must have `SELECT` permission on external table to read the data.
4749
External table access underlying Azure storage using the database scoped credential defined in data source using the following rules:
48-
- Data source without credential enable external tables to access publicly available files on Azure storage.
49-
- Data source can have credential that enables external tables to access only the files on Azure storage using SAS token or workspace Managed Identity - see [examples here](develop-storage-files-storage-access-control.md#examples).
50+
- Data source without credential enables external tables to access publicly available files on Azure storage.
51+
- Data source can have credential that enables external tables to access only the files on Azure storage using SAS token or workspace Managed Identity - For examples, see [the Develop storage files storage access control](develop-storage-files-storage-access-control.md#examples) article.
5052

5153
> [!IMPORTANT]
5254
> In SQL pool, datasource without creadential enables Azure AD user to access storage files using their Azure AD identity. In SQL on-demand, you need to create data source with database-scoped credential that has `IDENTITY='User Identity'` property - see [examples here](develop-storage-files-storage-access-control.md#examples).
@@ -69,7 +71,7 @@ WITH
6971
[;]
7072
```
7173

72-
#### [SQL on-demand](#tab/sql-ondemand)
74+
#### [SQL on-demand](#tab/sql-on-demand)
7375

7476
```syntaxsql
7577
CREATE EXTERNAL DATA SOURCE <data_source_name>
@@ -79,11 +81,14 @@ WITH
7981
)
8082
[;]
8183
```
84+
8285
---
8386

8487
### Arguments for CREATE EXTERNAL DATA SOURCE
8588

86-
data_source_name -Specifies the user-defined name for the data source. The name must be unique within the database.
89+
data_source_name
90+
91+
Specifies the user-defined name for the data source. The name must be unique within the database.
8792

8893
#### Location
8994
LOCATION = `'<prefix>://<path>'` - Provides the connectivity protocol and path to the external data source. The path can include a container in the form of `'<prefix>://<path>/container'`, and a folder in the form of `'<prefix>://<path>/container/folder'`.
@@ -95,12 +100,14 @@ LOCATION = `'<prefix>://<path>'` - Provides the connectivity protocol and path
95100
| Azure Data Lake Store Gen 2 | `abfs[s]` | `<container>@<storage_account>.dfs.core.windows.net` |
96101

97102
#### Credential
98-
CREDENTIAL = `<database scoped credential>` is optional credential that will be used to authenticate on Azure storage. External data source without credential can access public storage account. External data sources without credential in SQL pool can also use callers Azure AD identity to access files on storage. External data source with credential use identity specified in credential to access files.
103+
CREDENTIAL = `<database scoped credential>` is optional credential that will be used to authenticate on Azure storage. External data source without credential can access public storage account.
104+
105+
External data sources without credential in SQL pool can also use callers Azure AD identity to access files on storage. External data source with credential use identity specified in credential to access files.
99106
- In SQL pool, database scoped credential can specify custom application identity, workspace Managed Identity, or SAK key.
100107
- In SQL on-demand, database scoped credential can specify caller's Azure AD identity, workspace Managed Identity, or SAS key.
101108

102109
#### TYPE
103-
TYPE = `HADOOP` is mandatory option in SQL pool and specify that Polybase technology is used to access underlying files. This parameter cannot be used in SQL on-demand service that uses built-in native reader.
110+
TYPE = `HADOOP` is mandatory option in SQL pool and specify that Polybase technology is used to access underlying files. This parameter can't be used in SQL on-demand service that uses built-in native reader.
104111

105112
### Example for CREATE EXTERNAL DATA SOURCE
106113

@@ -118,7 +125,7 @@ WITH
118125
) ;
119126
```
120127

121-
#### [SQL on-demand](#tab/sql-ondemand)
128+
#### [SQL on-demand](#tab/sql-on-demand)
122129

123130
The following example creates an external data source for Azure Data Lake Gen2 that can be accessed using SAS credential:
124131

@@ -344,7 +351,7 @@ Using Data Lake exploration capabilities you can now create and query an externa
344351

345352
- You must have at least [permissions to create](/sql/t-sql/statements/create-external-table-transact-sql?toc=/azure/synapse-analytics/toc.json&bc=/azure/synapse-analytics/breadcrumb/toc.json&view=azure-sqldw-latest#permissions-2) and query external tables on the SQL pool or SQL OD
346353

347-
- The linked service associated with the ADLS Gen2 Account **must have access to the file**. For example, if the linked service authentication mechanism is Managed Identity, the workspace managed identity must have at least Storage blob reader permission on the storage account
354+
- The linked service associated with the ADLS Gen2 Account **must have access to the file**. For example, if the linked service authentication mechanism is Managed Identity, the workspace Managed Identity must have at least Storage blob reader permission on the storage account
348355

349356
From the Data panel, select the file that you would like to create the external table from:
350357
> [!div class="mx-imgBorder"]

0 commit comments

Comments
 (0)