sp_droptype

Drops a user-defined datatype.

Syntax

sp_droptype typename

Parameters

Examples

Usage

Executing sp_droptype deletes a user-defined datatype from systypes.

You cannot drop a user-defined datatype if it is referenced by tables or another database object.

See also User-Defined Datatypes in Reference Manual: Building Blocks.

Permissions

The permission checks for sp_droptype differ based on your granular permissions settings.

SettingDescription
Enabled

With granular permissions enabled, you must be the datatype owner or a user with manage database privilege.

Disabled

With granular permissions disabled, you must be datatype owner or database owner.

Auditing

Values in event and extrainfo columns from the sysaudits table are:

InformationValues
Event

38

Audit option

exec_procedure

Command or access audited

Execution of a procedure

Information in extrainfo
  • Roles – Current active roles

  • Keywords or options – NULL

  • Previous value – NULL

  • Current value – NULL

  • Other information – All input parameters

  • Proxy information – Original login name, if set proxy in effect

Related reference
sp_addtype
sp_rename