DP-300 Implement a secure environment Practice Question
Which TWO actions should you take to secure Azure SQL Database against SQL injection attacks?
⚠ Common exam trap
Candidates often confuse security features like encryption (TDE) or network controls (firewall rules) with application-layer defenses, mistakenly thinking they prevent SQL injection when they only address different threat vectors.
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
✓
Use parameterized queries in application code
Option D is correct because parameterized queries cause the database engine to treat user input strictly as data rather than executable SQL, so injected payloads cannot alter the query's structure or logic. Option E is correct because stored procedures that accept parameters likewise bind input values to typed parameters, preventing attackers from concatenating malicious SQL into the statement. Both techniques address the root cause of SQL injection at the application/database interface. Option A (Transparent Data Encryption) only encrypts data at rest and does nothing to stop injection. Option B (auditing) merely records activity for detection and forensics, not prevention. Option C (firewall rules) restricts network origins but cannot stop injection from an already-trusted client or application.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Enable Transparent Data Encryption
Why it's wrong here
Transparent Data Encryption encrypts data at rest, leaving the structure and execution of injected SQL statements unchanged. It is tempting because it protects database files and backups from disclosure, which is the right control for stolen media rather than for injection through application input.
- ✗
Enable auditing for all database operations
Why it's wrong here
Auditing records executed statements after the fact, providing detection and forensic evidence but no blocking of malicious input. It is tempting because it supports compliance and incident investigation, which is the correct purpose when the requirement is monitoring rather than prevention of injection.
- ✗
Configure firewall rules to allow only trusted IP addresses
Why it's wrong here
Firewall rules filter connections by source IP, not the content of T-SQL statements, so injected payloads from an allowed address still execute. They are tempting because they restrict network reachability, which is correct for blocking untrusted hosts rather than for neutralising injection inside queries.
- ✓
Use parameterized queries in application code
Why this is correct
Parameterised queries send SQL text and data values to the engine as separate constructs, so user input is never concatenated into the statement and cannot alter its parse tree. This directly neutralises injection payloads, satisfying the requirement to secure Azure SQL Database against SQL injection attacks.
- ✓
Use stored procedures with parameters
Why this is correct
Stored procedures with parameters bind input values to typed parameters rather than concatenating them into dynamic SQL, so injected syntax is treated as data. This blocks the injection vector the question asks you to secure Azure SQL Database against.
Go deeper
Related to this question
Learn chapter
Optimizing Database Query and Index Performance
Key term
Transparent Data Encryption
Transparent Data Encryption is a security feature that automatically encrypts data written to a database and decrypts it when read, without requiring any changes to the application.
Key term
Azure SQL Performance Tuning
Azure SQL Performance Tuning is the process of optimizing the speed and efficiency of queries and database operations in Microsoft Azure SQL Database or SQL Managed Instance to reduce latency and improve throughput.
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 →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.