Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

sp_droptype (Transact-SQL)

Applies To: SQL Server 2014, SQL Server 2016 Preview

Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).

Deletes an alias data type from systypes.

Applies to: SQL Server (SQL Server 2008 through current version).

Topic link icon Transact-SQL Syntax Conventions

sp_droptype [ @typename = ] 'type'

[ @typename=] 'type'

Is the name of an alias data type that you own. type is sysname, with no default.

0 (success) or 1 (failure)

The type alias data type cannot be dropped if tables or other database objects reference it.

Note Note

An alias data type cannot be dropped if the alias data type is used within a table definition or if a rule or default is bound to it.

Requires membership in the db_owner fixed database role or the db_ddladmin fixed database role.

The following example drops the alias data type birthday.

Note Note

This alias data type must already exist or this example returns an error message.

USE master;
EXEC sp_droptype 'birthday';

Community Additions

© 2015 Microsoft