Courseiva

DP-300 Configure and manage automation of tasks Practice Question

You are implementing automated table partitioning maintenance for a large Azure SQL Database. The partitioning function uses a monthly range. You need to add a new partition for the next month and remove the oldest partition. What is the best way to automate this?

⚠ Common exam trap

DP-300 often tests the difference between SWITCH (moves data between a partition and a table) and SPLIT/MERGE (changes partition boundaries); candidates may choose SWITCH alone, forgetting that it does not update the partition function.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Schedule a T-SQL script via Elastic Database Jobs that uses ALTER PARTITION FUNCTION to SPLIT the range and MERGE the oldest boundary.

The correct approach is to schedule a T-SQL script via Elastic Database Jobs that uses ALTER PARTITION FUNCTION ... SPLIT to add a new boundary for the next month and MERGE to remove the oldest boundary. This automates partition maintenance without moving data or dropping tables, and Elastic Database Jobs provide cross-database scheduling native to Azure SQL Database.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Create a stored procedure that uses SELECT INTO to copy old data to a history table and then TRUNCATE the partition.

    Why it's wrong here

    SELECT INTO copies rows into a new history table and TRUNCATE empties the partition, but neither performs the metadata switch that moves a partition between tables; ALTER TABLE SWITCH PARTITION does this instantly. The copying approach is tempting for archiving, yet it scans and rewrites data rather than switching partitions.

  • ✗

    Use ALTER INDEX REORGANIZE to compress old partitions.

    Why it's wrong here

    ALTER INDEX REORGANIZE defragments and compresses existing index pages; it neither adds a partition for next month nor removes the oldest one, so the range boundary never moves. It is tempting because index maintenance is genuine partition upkeep, and would be correct when fragmentation, not partition rotation, is the problem.

  • ✓

    Schedule a T-SQL script via Elastic Database Jobs that uses ALTER PARTITION FUNCTION to SPLIT the range and MERGE the oldest boundary.

    Why this is correct

    ALTER PARTITION FUNCTION ... SPLIT adds the next month's boundary, while MERGE collapses the oldest one, keeping the monthly range current. Elastic Database Jobs run this T-SQL on a schedule without external compute, satisfying the automation requirement for Azure SQL Database, where SQL Agent is unavailable.

  • ✗

    Use the SWITCH PARTITION operation to move the oldest partition to a staging table and then drop the staging table.

    Why it's wrong here

    SWITCH PARTITION requires the staging table to share the same filegroup and partition scheme alignment, and it moves data rather than advancing the range boundary, so next month's partition is never added. It is tempting because switching out old data is a real archival technique, correct when the range function already covers the target period.

About these practice questions

This DP-300 question is part of Courseiva's 574-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Microsoft exam blueprint

This DP-300 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DP-300 exam.