nerdexam
Microsoft

DP-300 · Question #397

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might…

The correct answer is A. Yes. Option A (Yes) is correct because the solution uses sp_set_database_firewall_rule, which creates database-level firewall rules that apply specifically to individual databases rather than the entire SQL server. By running the rule on DB1 with the Branch1 IP range…

Submitted by lukas.cz· Mar 6, 2026Implement a secure environment

Question

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution. After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen. You have the on-premises networks shown in the following table. You have an Azure subscription that contains an Azure SQL Database server named SQL1. SQL1 contains two databases named DB1 and DB2. You need to configure access to DB1 and DB2. The solution must meet the following requirements: - Ensure that DB1 can be accessed only by users in Branch1. - Ensure that DB2 can be accessed only by users in Branch2. Solution: You connect to DB1 and run the following command. EXECUTE sp_set_database_firewall_rule 'Allow db1 users', '131.107.10.0', '131.107.10.255' You connect to DB2 and run the following command. EXECUTE sp_set_database_firewall_rule 'Allow db2 users', '131.107.11.0', '131.107.11.255' Does this meet the goal?

Options

  • AYes
  • BNo

How the community answered

(23 responses)
  • A
    83% (19)
  • B
    17% (4)

Explanation

Option A (Yes) is correct because the solution uses sp_set_database_firewall_rule, which creates database-level firewall rules that apply specifically to individual databases rather than the entire SQL server. By running the rule on DB1 with the Branch1 IP range (131.107.10.0–131.107.10.255) and on DB2 with the Branch2 IP range (131.107.11.0–131.107.11.255), each database is independently restricted to its respective branch's users only.

Option B is incorrect because the commands are valid and precisely meet the requirements - database-level firewall rules are the correct tool here, as they allow granular, per-database access control rather than blanket server-wide rules.

Key distinction to remember: sp_set_database_firewall_rule = database-level firewall (run while connected to a specific database), whereas sp_set_firewall_rule = server-level firewall (affects all databases). If the question had used sp_set_firewall_rule, it would NOT meet the goal because a server-level rule cannot restrict access to individual databases separately.

Memory Tip: Think "DB rule = DataBase-level" - when you need to isolate access per database, always use the command with "database" in its name (sp_set_**database**_firewall_rule).

Topics

#Azure SQL Database#Firewall Rules#Access Control#Security

Community Discussion

No community discussion yet for this question.

Full DP-300 Practice