Skip to content

Latest commit

 

History

History
58 lines (41 loc) · 2.79 KB

sp-create-openrowset-statistics.md

File metadata and controls

58 lines (41 loc) · 2.79 KB
title description author ms.author ms.date ms.service ms.topic f1_keywords helpviewer_keywords dev_langs monikerRange
sp_create_openrowset_statistics (Transact-SQL)
The sp_create_openrowset_statistics system stored procedure creates column statistics for a column in the OPENROWSET path of Azure Synapse SQL resources.
WilliamDAssafMSFT
wiassaf
04/13/2022
synapse-analytics
reference
sp_create_openrowset_statistics_TSQL
sp_create_openrowset_statistics
sp_create_openrowset_statistics
TSQL
=azure-sqldw-latest||=azuresqldb-mi-current

sp_create_openrowset_statistics (Transact-SQL)

[!INCLUDE asdbmi-asa-svrless-poolonly]

Creates column statistics for a column in the OPENROWSET path of Azure Synapse serverless SQL pools. For more information, see Statistics in Synapse SQL. This procedure is also used by [!INCLUDEssazuremi-md] for column statistics in external data sources via OPENROWSET.

:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions

Syntax

sys.sp_create_openrowset_statistics [ @stmt = ] N'statement_text'

Arguments

[ @stmt = ] N'statement_text'

Specifies a Transact-SQL statement that will return column values to be used for statistics. You can use TABLESAMPLE within the @stmt to specify samples of data to be used. If TABLESAMPLE isn't specified, FULLSCAN will be used. For CSV data sources, only FULLSCAN is supported.

<tablesample_clause> ::= TABLESAMPLE ( sample_number PERCENT )

Remarks

Use sys.sp_create_openrowset_statistics to create statistics on external data sources via OPENROWSET. Currently, you can create single-column statistics only.

Statistics metadata is not available for OPENROWSET columns.

For statistics on external table columns, use CREATE STATISTICS instead. For more information, see Create statistics for external table column.

Permissions

Requires ADMINISTER BULK OPERATIONS or ADMINISTER DATABASE BULK OPERATIONS permissions.

Example

For usage scenarios and examples, review Create statistics for column in OPENROWSET path.

See also

Next steps