| title | sp_create_openrowset_statistics (Transact-SQL) | ||
|---|---|---|---|
| description | sp_create_openrowset_statistics creates column statistics for a column in the OPENROWSET path of Azure Synapse SQL resources. | ||
| author | WilliamDAssafMSFT | ||
| ms.author | wiassaf | ||
| ms.reviewer | randolphwest | ||
| ms.date | 06/23/2025 | ||
| ms.service | azure-synapse-analytics | ||
| ms.topic | reference | ||
| f1_keywords |
|
||
| helpviewer_keywords |
|
||
| dev_langs |
|
||
| monikerRange | =azure-sqldw-latest || =azuresqldb-mi-current |
[!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 [!INCLUDE ssazuremi-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
sys.sp_create_openrowset_statistics [ @stmt = ] N'statement_text'
[!INCLUDE extended-stored-procedures]
Specifies a Transact-SQL statement that returns 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 is used. For CSV data sources, only FULLSCAN is supported.
<tablesample_clause> ::= TABLESAMPLE ( sample_number PERCENT )
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 isn't available for OPENROWSET columns.
For statistics on external table columns, use CREATE STATISTICS instead. For more information, see Create statistics for external table column.
Requires ADMINISTER BULK OPERATIONS or ADMINISTER DATABASE BULK OPERATIONS permissions.
For usage scenarios and examples, review Create statistics for column in OPENROWSET path.