下面语句的【问号】处应该填写什么??
DROP PARTITION SCHEME PS;
if exists(????)
DROP PARTITION FUNCTION PF;
备注: PS 为分区方案名称,PF 为分区函数名称。使用此分区方案,分区函数的table已经删除!
if exists(select *from sys.partition_functions where name ='xx')
--remove function
if exists(select *from sys.partition_schemes where name ='xx')
--remove scheme
通过两个系统目录视图:
sys.partition_functions/sys.partition_schemes可以查询到对应的数据库中所有相关分区函数与分区架构
另外可以使用sys.partition_range_values查询每个分区函数的区间值.