DROP AGGREGATE (Transact-SQL)
Updated: October 28, 2015
Applies To: SQL Server 2014, SQL Server 2016 Preview
Removes a user-defined aggregate function from the current database. User-defined aggregate functions are created by using CREATE AGGREGATE.
Applies to: SQL Server (SQL Server 2008 through current version).
- IF EXISTS
Applies to: SQL Server (SQL Server 2016 Community Technology Preview 3 (CTP 3.0) through current version).
Conditionally drops the aggregate only if it already exists.
Is the name of the schema to which the user-defined aggregate function belongs.
Is the name of the user-defined aggregate function you want to drop.
DROP AGGREGATE does not execute if there are any views, functions, or stored procedures created with schema binding that reference the user-defined aggregate function you want to drop.
To execute DROP AGGREGATE, at a minimum, a user must have ALTER permission on the schema to which the user-defined aggregate belongs, or CONTROL permission on the aggregate.