You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/synapse-analytics/sql/create-external-table-as-select.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,17 +17,16 @@ In this article, you'll learn how to store query results to storage using SQL On
17
17
18
18
## Prerequisites
19
19
20
-
Your first step is to review the articles below and make sure you've met the prerequisites:
20
+
Your first step is to **create a database** where you will execute the queries. Then initialize the objects by executing [setup script](https://github.com/Azure-Samples/Synapse/blob/master/SQL/Samples/LdwSample/SampleDB.sql) on that database. This setup script will create the data sources, database scoped credentials, and external file formats that are used to read data in these samples.
Follow the instructions in this article to create data sources, database scoped credentials, and external file formats that are used to write data into the output storage.
24
23
25
24
## Create external table as select
26
25
27
26
You can use the CREATE EXTERNAL TABLE AS SELECT (CETAS) statement to store the query results to storage.
28
27
29
28
> [!NOTE]
30
-
> Change the first line in the query, i.e., [mydbname], so you're using the database you created. If you have not created a database, please read [First-time setup](query-data-storage.md#first-time-setup). You need to change LOCATION for MyDataSource external data source to point to location you have write permission for.
29
+
> Change the first line in the query, i.e., [mydbname], so you're using the database you created.
You can use the external table created through CETAS like a regular external table.
75
75
76
76
> [!NOTE]
77
-
> Change the first line in the query, i.e., [mydbname], so you're using the database you created. If you have not created a database, please read [First-time setup](query-data-storage.md#first-time-setup).
77
+
> Change the first line in the query, i.e., [mydbname], so you're using the database you created.
78
78
79
79
```sql
80
80
USE [mydbname];
@@ -91,4 +91,4 @@ ORDER BY
91
91
92
92
## Next steps
93
93
94
-
For more information on how to query different file types, refer to the [Query single CSV file](query-single-csv-file.md), [Query Parquet files](query-parquet-files.md), and [Query JSON files](query-json-files.md) articles.
94
+
For more information on how to query different file types, see the [Query single CSV file](query-single-csv-file.md), [Query Parquet files](query-parquet-files.md), and [Query JSON files](query-json-files.md) articles.
0 commit comments