--- title: DROP STATISTICS (Transact-SQL) description: DROP STATISTICS (Transact-SQL) author: WilliamDAssafMSFT ms.author: wiassaf ms.date: "03/22/2016" ms.service: sql ms.subservice: t-sql ms.topic: reference f1_keywords: - "DROP STATISTICS" - "DROP_STATISTICS_TSQL" helpviewer_keywords: - "removing statistics" - "column statistics [SQL Server]" - "DROP STATISTICS statement" - "deleting statistics" - "dropping statistics" - "table statistics [SQL Server]" - "statistical information [SQL Server], removing" dev_langs: - "TSQL" monikerRange: ">=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-server-2016||>=sql-server-linux-2017||=azuresqldb-mi-current||=fabric" --- # DROP STATISTICS (Transact-SQL) [!INCLUDE [sql-asdb-asdbmi-asa-pdw-fabricse-fabricdw](../../includes/applies-to-version/sql-asdb-asdbmi-asa-pdw-fabricse-fabricdw.md)] Drops statistics for multiple collections within the specified tables in the current database. ::: moniker range="=fabric" > [!NOTE] > For more information on statistics in [!INCLUDE [fabric](../../includes/fabric.md)], see [Statistics in [!INCLUDE [fabric](../../includes/fabric.md)]](/fabric/data-warehouse/statistics). ::: moniker-end :::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: [Transact-SQL syntax conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md) ## Syntax ```syntaxsql -- Syntax for SQL Server and Azure SQL Database DROP STATISTICS table.statistics_name | view.statistics_name [ ,...n ] ``` ```syntaxsql -- Syntax for Azure Synapse Analytics and Parallel Data Warehouse and Microsoft Fabric DROP STATISTICS [ schema_name . ] table_name.statistics_name [;] ``` ## Arguments *table* | *view* Is the name of the target table or indexed view for which statistics should be dropped. Table and view names must comply with the rules for [Database Identifiers](../../relational-databases/databases/database-identifiers.md). Specifying the table or view owner name is optional. *statistics_name* Is the name of the statistics group to drop. Statistics names must comply with the rules for identifiers ## Remarks Be careful when you drop statistics. Doing so may affect the execution plan chosen by the query optimizer. Statistics on indexes cannot be dropped by using DROP STATISTICS. Statistics remain as long as the index exists. For more information about displaying statistics, see [DBCC SHOW_STATISTICS (Transact-SQL)](../../t-sql/database-console-commands/dbcc-show-statistics-transact-sql.md). ## Permissions Requires ALTER permission on the table or view. ## Examples ### A. Dropping statistics from a table The following example drops the statistics groups (collections) of two tables. The `VendorCredit` statistics group (collection) of the `Vendor` table and the `CustomerTotal` statistics (collection) of the `SalesOrderHeader` table are dropped. ```sql -- Create the statistics groups. USE AdventureWorks2022; GO CREATE STATISTICS VendorCredit ON Purchasing.Vendor (Name, CreditRating) WITH SAMPLE 50 PERCENT CREATE STATISTICS CustomerTotal ON Sales.SalesOrderHeader (CustomerID, TotalDue) WITH FULLSCAN; GO DROP STATISTICS Purchasing.Vendor.VendorCredit, Sales.SalesOrderHeader.CustomerTotal; ``` ## Examples: [!INCLUDE[ssazuresynapse-md](../../includes/ssazuresynapse-md.md)] and [!INCLUDE[ssPDW](../../includes/sspdw-md.md)] ### B. Dropping statistics from a table The following examples drop the `CustomerStats1` statistics from table `Customer`. ```sql DROP STATISTICS Customer.CustomerStats1; DROP STATISTICS dbo.Customer.CustomerStats1; ``` ## See Also [ALTER DATABASE (Transact-SQL)](../../t-sql/statements/alter-database-transact-sql.md) [CREATE INDEX (Transact-SQL)](../../t-sql/statements/create-index-transact-sql.md) [CREATE STATISTICS (Transact-SQL)](../../t-sql/statements/create-statistics-transact-sql.md) [sys.stats (Transact-SQL)](../../relational-databases/system-catalog-views/sys-stats-transact-sql.md) [sys.stats_columns (Transact-SQL)](../../relational-databases/system-catalog-views/sys-stats-columns-transact-sql.md) [DBCC SHOW_STATISTICS (Transact-SQL)](../../t-sql/database-console-commands/dbcc-show-statistics-transact-sql.md) [sp_autostats (Transact-SQL)](../../relational-databases/system-stored-procedures/sp-autostats-transact-sql.md) [sp_createstats (Transact-SQL)](../../relational-databases/system-stored-procedures/sp-createstats-transact-sql.md) [UPDATE STATISTICS (Transact-SQL)](../../t-sql/statements/update-statistics-transact-sql.md) [EVENTDATA (Transact-SQL)](../../t-sql/functions/eventdata-transact-sql.md) [USE (Transact-SQL)](../../t-sql/language-elements/use-transact-sql.md) [Statistics in Microsoft Fabric](/fabric/data-warehouse/statistics)