DROP STATISTICS (Transact-SQL)
Applies To: SQL Server 2014, SQL Server 2016 Preview
Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).
Drops statistics for multiple collections within the specified tables in the current database.
Applies to: SQL Server (SQL Server 2008 through current version), Azure SQL Database, Azure SQL Data Warehouse Public Preview.
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).
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.
-- Create the statistics groups. USE AdventureWorks2012; 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;