DROP PARTITION FUNCTION (Transact-SQL)DROP PARTITION FUNCTION (Transact-SQL)

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

從目前資料庫移除資料分割函數。Removes a partition function from the current database. 資料分割函數是以 CREATE PARTITION FUNCTION 建立,並且以 ALTER PARTITION FUNCTION 修改。Partition functions are created by using CREATE PARTITION FUNCTION and modified by using ALTER PARTITION FUNCTION.

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

語法Syntax

  
DROP PARTITION FUNCTION partition_function_name [ ; ]  

引數Arguments

partition_function_namepartition_function_name
這是要卸除的資料分割函數名稱。Is the name of the partition function that is to be dropped.

RemarksRemarks

只有在沒有目前使用資料分割函數的資料分割結構描述時,才可以卸除資料分割函數。A partition function can be dropped only if there are no partition schemes currently using the partition function. 如果有使用資料分割函數的資料分割結構描述,DROP PARTITION FUNCTION 就會傳回錯誤。If there are partition schemes using the partition function, DROP PARTITION FUNCTION returns an error.

權限Permissions

下列任何一個權限,都可以用來執行 DROP PARTITION FUNCTION:Any one of the following permissions can be used to execute DROP PARTITION FUNCTION:

  • ALTER ANY DATASPACE 權限。ALTER ANY DATASPACE permission. 這個權限預設會授與 sysadmin 固定伺服器角色以及 db_ownerdb_ddladmin 固定資料庫角色的成員。This permission defaults to members of the sysadmin fixed server role and the db_owner and db_ddladmin fixed database roles.

  • 對於建立資料分割函數之資料庫的 CONTROL 或 ALTER 權限。CONTROL or ALTER permission on the database in which the partition function was created.

  • 對於建立資料分割函數之資料庫伺服器的 CONTROL SERVER 或 ALTER ANY DATABASE 權限。CONTROL SERVER or ALTER ANY DATABASE permission on the server of the database in which the partition function was created.

範例Examples

下列範例假設目前資料庫中已建立了資料分割函數 myRangePFThe following example assumes the partition function myRangePF has been created in the current database.

DROP PARTITION FUNCTION myRangePF;  

另請參閱See Also

CREATE PARTITION FUNCTION (Transact-SQL) CREATE PARTITION FUNCTION (Transact-SQL)
ALTER PARTITION FUNCTION (Transact-SQL) ALTER PARTITION FUNCTION (Transact-SQL)
EVENTDATA (Transact-SQL) EVENTDATA (Transact-SQL)
sys.partition_functions (Transact-SQL) sys.partition_functions (Transact-SQL)
sys.partition_parameters (Transact-SQL) sys.partition_parameters (Transact-SQL)
sys.partition_range_values (Transact-SQL) sys.partition_range_values (Transact-SQL)
sys.partitions (Transact-SQL) sys.partitions (Transact-SQL)
sys.tables (Transact-SQL) sys.tables (Transact-SQL)
sys.indexes (Transact-SQL) sys.indexes (Transact-SQL)
sys.index_columns (Transact-SQL)sys.index_columns (Transact-SQL)