Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Latest commit

 

History

History
70 lines (55 loc) · 3.42 KB

drop-partition-function-transact-sql.md

File metadata and controls

70 lines (55 loc) · 3.42 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
DROP PARTITION FUNCTION (Transact-SQL)
DROP PARTITION FUNCTION (Transact-SQL)
WilliamDAssafMSFT
wiassaf
03/06/2017
sql
t-sql
reference
DROP PARTITION FUNCTION
DROP_PARTITION_FUNCTION_TSQL
deleting partition functions
DROP PARTITION FUNCTION statement
partition functions [SQL Server], removing
dropping partition functions
removing partition functions
TSQL

DROP PARTITION FUNCTION (Transact-SQL)

[!INCLUDE SQL Server Azure SQL Database Azure SQL Managed Instance]

Removes a partition function from the current database. Partition functions are created by using CREATE PARTITION FUNCTION and modified by using ALTER PARTITION FUNCTION.

:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions

Syntax

DROP PARTITION FUNCTION partition_function_name [ ; ]  

Arguments

partition_function_name
Is the name of the partition function that is to be dropped.

Remarks

A partition function can be dropped only if there are no partition schemes currently using the partition function. If there are partition schemes using the partition function, DROP PARTITION FUNCTION returns an error.

Permissions

Any one of the following permissions can be used to execute DROP PARTITION FUNCTION:

  • ALTER ANY DATASPACE permission. This permission defaults to members of the sysadmin fixed server role and the db_owner and db_ddladmin fixed database roles.

  • CONTROL or ALTER permission on the database in which the partition function was created.

  • CONTROL SERVER or ALTER ANY DATABASE permission on the server of the database in which the partition function was created.

Examples

The 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)
ALTER PARTITION FUNCTION (Transact-SQL)
EVENTDATA (Transact-SQL)
sys.partition_functions (Transact-SQL)
sys.partition_parameters (Transact-SQL)
sys.partition_range_values (Transact-SQL)
sys.partitions (Transact-SQL)
sys.tables (Transact-SQL)
sys.indexes (Transact-SQL)
sys.index_columns (Transact-SQL)