sp_droptype (Transact-SQL)sp_droptype (Transact-SQL)

適用於: 是SQL Server 否Azure SQL Database 否Azure Synapse Analytics (SQL DW) 否平行處理資料倉儲 APPLIES TO: yesSQL Server noAzure SQL Database noAzure Synapse Analytics (SQL DW) noParallel Data Warehouse

刪除別名資料類型從systypesDeletes an alias data type from systypes.

主題連結圖示 Transact-SQL 語法慣例Topic link icon Transact-SQL Syntax Conventions

語法Syntax

  
sp_droptype [ @typename = ] 'type'  

引數Arguments

[ @typename = ] 'type' 是您所擁有的別名資料型別名稱。[ @typename = ] 'type' Is the name of an alias data type that you own. 型別sysname,沒有預設值。type is sysname, with no default.

傳回碼類型Return Code Type

0 (成功) 或 1 (失敗)0 (success) or 1 (failure)

結果集Result Sets

NoneNone

備註Remarks

型別別名資料型別無法卸除如果資料表或其他資料庫物件參考它。The type alias data type cannot be dropped if tables or other database objects reference it.

注意

如果別名資料類型用於資料表定義中,或者如果有規則或預設值與它繫結,就無法卸除別名資料類型。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.

PermissionsPermissions

需要的成員資格db_owner固定的資料庫角色或db_ddladmin固定的資料庫角色。Requires membership in the db_owner fixed database role or the db_ddladmin fixed database role.

範例Examples

下列範例會卸除別名資料類型 birthdayThe 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  

另請參閱See Also

Database Engine 預存程序(Transact SQL) Database Engine Stored Procedures (Transact-SQL)
sp_addtype (Transact-SQL) sp_addtype (Transact-SQL)
sp_rename (Transact-SQL) sp_rename (Transact-SQL)
系統預存程序 (Transact-SQL)System Stored Procedures (Transact-SQL)