Freigeben über


DROP STATISTICS (U-SQL)

Summary

U-SQL provides the DROP STATISTICS statement to drop the specified statistic of a table.

Note that dropping statistics may have negative impact on the performance on queries over the associated table.

Warning

This operation cannot be undone!

Syntax

Drop_Statistics_Statement :=                                                                             
    'DROP' 'STATISTICS' ['IF' 'EXISTS']  
    Statistic_Name 'ON' Table_Name.
Statistic_Name := Quoted_or_Unquoted_Identifier.
Table_Name := Identifier.

Remarks

  • Statistic_Name ON Table_Name
    Specifies the name (either a quoted or unquoted identifier) of the statistic of the given table to be dropped.

  • IF EXISTS
    If the statistic does not exist or the user does not have permissions, then an error is raised, unless IF EXISTS is specified. In that case, if the user has at least enumeration permission on the table, the operation will silently complete without action. If the user has no enumeration permission, an error is raised.

Examples

  • The example can be executed in Visual Studio with the Azure Data Lake Tools plug-in.
  • The script can be executed locally. An Azure subscription and Azure Data Lake Analytics account is not needed when executed locally.

The following example drops the statistics, ordersStats, within the table Orders in TestReferenceDB.

DROP STATISTICS IF EXISTS ordersStats ON TestReferenceDB.dbo.Orders;   

See Also