| title | DROP AGGREGATE (Transact-SQL) | Microsoft Docs | ||||||
|---|---|---|---|---|---|---|---|
| ms.custom |
|
||||||
| ms.date | 10/28/2015 | ||||||
| ms.prod | sql-non-specified | ||||||
| ms.reviewer | |||||||
| ms.suite | |||||||
| ms.technology |
|
||||||
| ms.tgt_pltfrm | |||||||
| ms.topic | language-reference | ||||||
| f1_keywords |
|
||||||
| dev_langs |
|
||||||
| helpviewer_keywords |
|
||||||
| ms.assetid | 84ffc4e7-c451-4f1f-9a67-7fc3a120e53f | ||||||
| caps.latest.revision | 31 | ||||||
| author | JennieHubbard | ||||||
| ms.author | jhubbard | ||||||
| manager | jhubbard |
[!INCLUDEtsql-appliesto-ss2008-xxxx-xxxx-xxx_md]
Removes a user-defined aggregate function from the current database. User-defined aggregate functions are created by using CREATE AGGREGATE.
Transact-SQL Syntax Conventions
DROP AGGREGATE [ IF EXISTS ] [ schema_name . ] aggregate_name
IF EXISTS
| Applies to: [!INCLUDEssNoVersion] ([!INCLUDEssSQL15] through current version). |
Conditionally drops the aggregate only if it already exists.
schema_name
Is the name of the schema to which the user-defined aggregate function belongs.
aggregate_name
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.
The following example drops the aggregate Concatenate.
DROP AGGREGATE dbo.Concatenate;
CREATE AGGREGATE (Transact-SQL)
Create User-defined Aggregates