DP-203 Develop data processing Practice Question
You are using Azure Data Factory to copy data from Azure Blob Storage to Azure SQL Database. The copy operation fails with error 'Cannot insert duplicate key'. What is the most likely cause and solution?
⚠ Common exam trap
A common mix-up: candidates confuse duplicate key errors with schema or format issues, or think staging is required for deduplication, but the correct solution is to use upsert to handle primary key conflicts.
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
✓
The sink table has a primary key, and the source contains duplicate rows; enable upsert in the copy activity
The error 'Cannot insert duplicate key' indicates that the sink table in Azure SQL Database has a primary key or unique constraint, and the source data contains rows with duplicate key values. Enabling upsert in the copy activity allows Azure Data Factory to handle duplicates by updating existing rows instead of failing, resolving the conflict.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The source files are in an incompatible format; convert to CSV
Why it's wrong here
Format is not related to duplicate key errors.
- ✗
The sink table schema does not match the source; update the schema
Why it's wrong here
Schema mismatch would cause a different error.
- ✗
The copy activity is not using staging; enable staging
Why it's wrong here
Staging improves performance but does not handle duplicates.
- ✓
The sink table has a primary key, and the source contains duplicate rows; enable upsert in the copy activity
Why this is correct
Upsert behavior can handle duplicate key violations.
Visual reference
Quick reference
Azure Blob Storage Tier Comparison
| Tier | Storage Cost | Retrieval Cost | Latency | Use Case |
|---|---|---|---|---|
| Hot | Highest | Lowest | Immediate | Active data, frequent reads |
| Cool | Lower | Higher | Immediate | Data accessed < once / month |
| Cold | Lower still | Higher | Immediate | Data accessed < once / quarter |
| Archive | Lowest | Highest + rehydration delay | Hours | Long-term compliance retention |
Go deeper
Related to this question
About these practice questions
Courseiva writes every DP-203 question from scratch — 760 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DP-203 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-203 exam.