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/query-data-storage.md
+4-75Lines changed: 4 additions & 75 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ ms.reviewer: jrasnick, carlrab
14
14
# Overview: Query data in storage
15
15
16
16
This section contains sample queries you can use to try out the SQL on-demand (preview) resource within Azure Synapse Analytics.
17
-
Currently supported files are:
17
+
Currently supported file formats are:
18
18
- CSV
19
19
- Parquet
20
20
- JSON
@@ -39,14 +39,7 @@ Additionally, the parameters are as follows:
39
39
40
40
## First-time setup
41
41
42
-
Before using the samples included later in this article, you have two steps:
43
-
44
-
- Create a database for your views (in case you want to use views)
45
-
- Create credentials to be used by SQL on-demand to access the files in storage
46
-
47
-
### Create database
48
-
49
-
You need a database to create views. You'll use this database for some of the sample queries in this documentation.
42
+
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.
50
43
51
44
> [!NOTE]
52
45
> Databases are only used for viewing metadata, not for actual data. Write down the database name that you use, you will need it later on.
@@ -55,53 +48,6 @@ You need a database to create views. You'll use this database for some of the sa
55
48
CREATEDATABASEmydbname;
56
49
```
57
50
58
-
### Create credentials
59
-
60
-
You must create credentials before you can run queries. This credential will be used by SQL on-demand service to access the files in storage.
61
-
62
-
> [!NOTE]
63
-
> In order to successfully run How To's in this section you have to use SAS token.
64
-
>
65
-
> To start using SAS tokens you have to drop the UserIdentity which is explained in the following [article](develop-storage-files-storage-access-control.md#disable-forcing-azure-ad-pass-through).
66
-
>
67
-
> SQL on-demand by default always uses AAD pass-through.
68
-
69
-
For more information on how to manage storage access control, check this [link](develop-storage-files-storage-access-control.md).
70
-
71
-
To create credentials for CSV, JSON, and Parquet containers, run the code below:
72
-
73
-
```sql
74
-
-- create credentials for CSV container in our demo storage account
75
-
IF EXISTS (SELECT*FROMsys.credentialsWHERE name ='https://sqlondemandstorage.blob.core.windows.net/csv')
76
-
DROP CREDENTIAL [https://sqlondemandstorage.blob.core.windows.net/csv];
@@ -127,24 +73,6 @@ Demo data contains the following data sets:
127
73
| /json/ | Parent folder for data in JSON format |
128
74
| /json/books/ | JSON files with books data |
129
75
130
-
## Validation
131
-
132
-
Execute the following three queries and check if the credentials are created correctly.
133
-
134
-
> [!NOTE]
135
-
> All URIs in the sample queries use a storage account located in the North Europe Azure region. Make sure that you created the appropriate credential. Run the query below and make sure the storage account is listed.
136
-
137
-
```sql
138
-
SELECT name
139
-
FROMsys.credentials
140
-
WHERE
141
-
name IN ( 'https://sqlondemandstorage.blob.core.windows.net/csv',
0 commit comments