Skip to content

Latest commit

 

History

History
63 lines (50 loc) · 2.41 KB

drop-aggregate-transact-sql.md

File metadata and controls

63 lines (50 loc) · 2.41 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
DROP AGGREGATE (Transact-SQL)
DROP AGGREGATE (Transact-SQL)
markingmyname
maghan
05/10/2017
sql
t-sql
reference
DROP_AGGREGATE_TSQL
DROP AGGREGATE
aggregate functions [SQL Server], removing
removing user-defined functions
dropping user-defined functions
user-defined functions [CLR integration]
deleting user-defined functions
DROP AGGREGATE statement
TSQL

DROP AGGREGATE (Transact-SQL)

[!INCLUDE SQL Server]

Removes a user-defined aggregate function from the current database. User-defined aggregate functions are created by using CREATE AGGREGATE.

:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions

Syntax

DROP AGGREGATE [ IF EXISTS ] [ schema_name . ] aggregate_name  

Arguments

IF EXISTS
Applies to: [!INCLUDEssNoVersion] ( [!INCLUDEsssql16-md] 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.

Remarks

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.

Permissions

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.

Examples

The following example drops the aggregate Concatenate.

DROP AGGREGATE dbo.Concatenate;  

See Also

CREATE AGGREGATE (Transact-SQL)
Create User-defined Aggregates