Skip to content

Commit a0d40e2

Browse files
authored
Merge pull request #99005 from LiliamLeme/patch-5
Update develop-tables-statistics.md
2 parents e9a5fff + 448adaa commit a0d40e2

File tree

1 file changed

+9
-24
lines changed

1 file changed

+9
-24
lines changed

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

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -647,34 +647,19 @@ To create statistics on a column, provide a query that returns the column for wh
647647

648648
By default, if you don't specify otherwise, serverless SQL pool uses 100% of the data provided in the dataset when it creates statistics.
649649

650-
For example, to create statistics with default options (FULLSCAN) for a year column of the dataset based on the population.csv file:
650+
For example, to create statistics with default options (FULLSCAN) for a population column of the dataset based on the us_population.csv file:
651651

652652
```sql
653-
/* make sure you have credentials for storage account access created
654-
IF EXISTS (SELECT * FROM sys.credentials WHERE name = 'https://azureopendatastorage.blob.core.windows.net/censusdatacontainer')
655-
DROP CREDENTIAL [https://azureopendatastorage.blob.core.windows.net/censusdatacontainer]
656-
GO
657-
658-
CREATE CREDENTIAL [https://azureopendatastorage.blob.core.windows.net/censusdatacontainer]
659-
WITH IDENTITY='SHARED ACCESS SIGNATURE',
660-
SECRET = ''
661-
GO
662-
*/
663653

664-
EXEC sys.sp_create_openrowset_statistics N'SELECT year
654+
EXEC sys.sp_create_openrowset_statistics N'SELECT
655+
population
665656
FROM OPENROWSET(
666-
BULK ''https://sqlondemandstorage.blob.core.windows.net/csv/population/population.csv'',
667-
FORMAT = ''CSV'',
668-
FIELDTERMINATOR ='','',
669-
ROWTERMINATOR = ''\n''
670-
)
671-
WITH (
672-
[country_code] VARCHAR (5) COLLATE Latin1_General_BIN2,
673-
[country_name] VARCHAR (100) COLLATE Latin1_General_BIN2,
674-
[year] smallint,
675-
[population] bigint
676-
) AS [r]
677-
'
657+
BULK ''Https://azureopendatastorage.blob.core.windows.net/censusdatacontainer/raw_us_population_county/us_population.csv'',
658+
FORMAT = ''CSV'',
659+
PARSER_VERSION = ''2.0'',
660+
HEADER_ROW = TRUE)
661+
AS [r]'
662+
678663
```
679664

680665
#### Create single-column statistics by specifying the sample size

0 commit comments

Comments
 (0)