sp_droptype (T-SQL)

Deletes a user-defined data type from systypes.

Syntax

sp_droptype [@typename =] 'type'

Arguments
[@typename =] 'type'
Is the name of a user-defined data type that you own. type is sysname, with no default.
Return Code Type

0 (success) or 1 (failure)

Result Sets

None

Remarks

The type user-defined data type cannot be dropped if tables or other database objects reference it.


Note A user-defined data type cannot be dropped if the user-defined data type is used within a table definition or if a rule or default is bound to it.


Permissions

Execute permissions default to the members of the db_owner fixed database role and the data type owner.

Examples

This example drops the user-defined data type birthday.


Note This user-defined data type must already exist or this example returns an error message.


USE master

EXEC sp_droptype 'birthday'

  

See Also
sp_addtype System Stored Procedures
sp_rename  

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.