nerdexam
Microsoft

70-465 · Question #122

You have two databases named DB1 and DB2 that are located on the same server. You plan to create a stored procedure named SProc1 in DB1. SProc1 will query a table named Table2 in DB2. You need to…

The correct answer is B. Application roles. This question tests knowledge of SQL Server security mechanisms that allow stored procedures to access cross-database objects without exposing underlying tables directly to users.

Submitted by devops_kid· Mar 5, 2026Design database security solutions

Question

You have two databases named DB1 and DB2 that are located on the same server. You plan to create a stored procedure named SProc1 in DB1. SProc1 will query a table named Table2 in DB2. You need to recommend a solution to ensure that SProc1 can access Table2 without granting users direct access to Table2. What should you include in the recommendation? More than one answer choice may achieve the goal. Select the BEST answer.

Options

  • AContained databases
  • BApplication roles
  • CCross-database ownership chaining
  • DDigital certificates

How the community answered

(48 responses)
  • A
    6% (3)
  • B
    73% (35)
  • C
    17% (8)
  • D
    4% (2)

Why each option

This question tests knowledge of SQL Server security mechanisms that allow stored procedures to access cross-database objects without exposing underlying tables directly to users.

AContained databases

Contained databases isolate users and authentication within a single database boundary, but they actually restrict cross-database access rather than enabling it, making them unsuitable for this cross-database query scenario.

BApplication rolesCorrect

Application roles in SQL Server allow a stored procedure's execution context to be controlled such that users can execute SProc1 without having direct permissions on Table2 in DB2. By granting the application role permissions on Table2 and having SProc1 activated under that role's context, users interact only through the procedure. This provides the required abstraction layer between end users and the underlying table.

CCross-database ownership chaining

Cross-database ownership chaining can enable cross-database object access without explicit grants, but it requires the ownership chain to be unbroken across both databases and is considered a broader security risk since it implicitly grants access rather than tightly scoping it through a controlled mechanism like an application role.

DDigital certificates

Digital certificates can be used to sign stored procedures and enable cross-database access by mapping certificate-based users, which is a valid technical approach, but it is more complex to implement and less directly aligned with the goal of controlling user access through a role-based abstraction compared to application roles.

Concept tested: SQL Server cross-database access control without direct table permissions

Source: https://learn.microsoft.com/en-us/sql/relational-databases/security/authentication-access/application-roles

Topics

#Application roles#Cross-database access#Stored procedure security

Community Discussion

No community discussion yet for this question.

Full 70-465 Practice