Skip to content

Latest commit

 

History

History
63 lines (43 loc) · 2.49 KB

File metadata and controls

63 lines (43 loc) · 2.49 KB
title sp_drop_openrowset_statistics (Transact-SQL)
description The sp_drop_openrowset_statistics system stored procedure removes 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 sql
ms.topic reference
f1_keywords
sp_drop_openrowset_statistics_TSQL
sp_drop_openrowset_statistics
helpviewer_keywords
sp_drop_openrowset_statistics
dev_langs
TSQL
monikerRange =azure-sqldw-latest || =azuresqldb-mi-current

sp_drop_openrowset_statistics (Transact-SQL)

[!INCLUDE asdbmi-asa-svrless-poolonly]

In [!INCLUDE ssazuremi-md], this procedure is used to drop column statistics in external data sources via OPENROWSET.

This procedure is also used to drop column statistics for a column in the OPENROWSET path of Azure Synapse serverless SQL pools. For more information, see Statistics in Synapse SQL.

There's no direct method to update existing statistics. Instead, drop and create statistics using sp_create_openrowset_statistics.

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

Syntax

sys.sp_drop_openrowset_statistics
[ @stmt = ] N'stmt'

Arguments

[!INCLUDE extended-stored-procedures]

[ @stmt = ] N'stmt'

Specifies a Transact-SQL statement that returns column values to be used for statistics. You can use TABLESAMPLE within @stmt to specify samples of data to be used. If TABLESAMPLE isn't specified, FULLSCAN is used.

<tablesample_clause> ::= TABLESAMPLE ( sample_number PERCENT )

Remarks

Statistics metadata isn't available for OPENROWSET columns.

Permissions

Requires ADMINISTER BULK OPERATIONS or ADMINISTER DATABASE BULK OPERATIONS permissions.

Examples

For usage scenarios and examples, review Update statistics.

Related content