sp_droptype (Transact-SQL)
Applies to:
SQL Server
Deletes an alias data type from systypes
.
Transact-SQL syntax conventions
Syntax
sp_droptype [ @typename = ] N'typename'
[ ; ]
Arguments
[ @typename = ] N'typename'
The name of an alias data type that you own. @typename is sysname, with no default.
Return code type
0
(success) or 1
(failure).
Result set
None.
Remarks
The type alias data type can't be dropped if tables or other database objects reference it.
Note
An alias data type can't be dropped if the alias data type is used within a table definition or if a rule or default is bound to it.
Permissions
Requires membership in the db_owner fixed database role or the db_ddladmin fixed database role.
Examples
The following example drops the alias data type birthday
. This alias data type must already exist, or this example returns an error message.
USE master;
GO
EXEC sp_droptype 'birthday';
GO
Related content
Feedback
https://aka.ms/ContentUserFeedback.
Binnenkort: Gedurende 2024 worden GitHub Issues uitgefaseerd als het feedbackmechanisme voor inhoud. Dit wordt vervangen door een nieuw feedbacksysteem. Ga voor meer informatie naar:Feedback verzenden en bekijken voor