QuestionQ53

VerifiedDesign and develop database solutions

You have a SQL database in Microsoft Fabric that contains a table named dbo.Orders.

  • dbo.Orders has a clustered index.
  • It contains three years of data.
  • It is partitioned by a column named OrderDate by month.

You need to remove all rows for the oldest month. The solution must minimize the impact on other queries that access the data in dbo.Orders.

Solution: Determine the partition scheme for the oldest month, then execute the following Transact-SQL statement.

ALTER TABLE dbo.Orders -  
DROP PARTITION SCHEME (partition_scheme_name);  

Does this achieve the goal?

Explanation

DROP PARTITION SCHEME is a standalone Transact-SQL statement, not an ALTER TABLE operation, and a partition scheme cannot be dropped while a table or index uses it. Dropping the scheme would not selectively remove the oldest monthly partition from dbo.Orders. Microsoft Learn: DROP PARTITION SCHEME (Transact-SQL)

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!