Skip to content

Commit 40e0b4a

Browse files
authored
Merge pull request #116448 from jovanpop-msft/patch-172
Update create-external-table-as-select.md
2 parents eb7a591 + 6493d35 commit 40e0b4a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

articles/synapse-analytics/sql/create-external-table-as-select.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,16 @@ In this article, you'll learn how to store query results to storage using SQL On
1717

1818
## Prerequisites
1919

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.
2121

22-
- [First-time setup](query-data-storage.md#first-time-setup)
23-
- [Prerequisites](query-data-storage.md#prerequisites)
22+
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.
2423

2524
## Create external table as select
2625

2726
You can use the CREATE EXTERNAL TABLE AS SELECT (CETAS) statement to store the query results to storage.
2827

2928
> [!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.
3130
3231
```sql
3332
USE [mydbname];
@@ -58,8 +57,9 @@ SELECT
5857
*
5958
FROM
6059
OPENROWSET(
61-
BULK 'https://sqlondemandstorage.blob.core.windows.net/csv/population-unix/population.csv',
62-
FORMAT='CSV'
60+
BULK 'csv/population-unix/population.csv',
61+
DATA_SOURCE = 'sqlondemanddemo',
62+
FORMAT = 'CSV', PARSER_VERSION = '2.0',
6363
) WITH (
6464
CountryCode varchar(4),
6565
CountryName varchar(64),
@@ -74,7 +74,7 @@ FROM
7474
You can use the external table created through CETAS like a regular external table.
7575

7676
> [!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.
7878
7979
```sql
8080
USE [mydbname];
@@ -91,4 +91,4 @@ ORDER BY
9191

9292
## Next steps
9393

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

Comments
 (0)