DROP TYPE (Transact-SQL)

**APPLIES TO:** ![yes](media/yes.png)SQL Server (starting with 2008) ![yes](media/yes.png)Azure SQL Database ![no](media/no.png)Azure SQL Data Warehouse ![no](media/no.png)Parallel Data Warehouse

Removes an alias data type or a common language runtime (CLR) user-defined type from the current database.

Topic link icon Transact-SQL Syntax Conventions

Syntax

DROP TYPE [ IF EXISTS ] [ schema_name. ] type_name [ ; ]  

Arguments

IF EXISTS
Applies to: SQL Server SQL Server SQL Server 2016 (13.x) through current version).

Conditionally drops the type only if it already exists.

schema_name
Is the name of the schema to which the alias or user-defined type belongs.

type_name
Is the name of the alias data type or the user-defined type you want to drop.

Remarks

The DROP TYPE statement will not execute when any of the following is true:

Permissions

Requires either CONTROL permission on type_name or ALTER permission on schema_name.

Examples

The following example assumes a type named ssn is already created in the current database.

DROP TYPE ssn ;  

See Also

CREATE TYPE (Transact-SQL)
EVENTDATA (Transact-SQL)