SQL Flow Field Guide

DROP AGGREGATE

Catalog support for SQL Server 2022 (16.x) and 2025 (17.x)

removes a CLR user-defined aggregate

What changes

Input
module body (its own statements and their sources)
Output or change
module definition

Syntax at a glance

DROP AGGREGATE [ IF EXISTS ] [ schema_name . ] aggregate_name

Work example

A CLR aggregate is no longer used by any deployed query or module.

Find dependent functions, views, procedures, and jobs before planning the removal.

Check your work No dependent module references the aggregate and the assembly remains only if another object needs it.

Open Microsoft Learn for full syntax, permissions, and details for your version.