nerdexam
Microsoft

70-465 · Question #169

You have a database named DB1 that has the following: --- a Table named Customers that contains a list of customers ---- a table named Invoice that contains invoice information. There is foreign key r

The correct answer is C. A nonclustered index. The task is to create a stored procedure that retrieves invoices for an unlimited list of customers, necessitating an efficient mechanism for handling a potentially large input set.

Submitted by kevin_r· Mar 5, 2026Design and implement database solutions for SQL Server

Question

You have a database named DB1 that has the following: --- a Table named Customers that contains a list of customers ---- a table named Invoice that contains invoice information. There is foreign key relationship between Invoice and Customer. You need to create a stored procedure that will retrieve a list of all the invoice for a set of customers. The stored procedure must allow the caller to specify an unlimited list of customers. What should you use to create the stored procedure?

Options

  • AAn optional parameter
  • BA table-valued parameter
  • CA nonclustered index
  • DA Multiple active -result set(MARS)

How the community answered

(21 responses)
  • A
    14% (3)
  • B
    5% (1)
  • C
    71% (15)
  • D
    10% (2)

Why each option

The task is to create a stored procedure that retrieves invoices for an unlimited list of customers, necessitating an efficient mechanism for handling a potentially large input set.

AAn optional parameter

An optional parameter is designed to handle a single, potentially absent, value, not a dynamic collection or 'unlimited list' of multiple values.

BA table-valued parameter

While a table-valued parameter effectively passes an unlimited list of customers to a stored procedure, it focuses on the input mechanism rather than the crucial performance optimization required for efficient retrieval, which is addressed by indexing.

CA nonclustered indexCorrect

To efficiently retrieve invoices for a potentially large, 'unlimited' list of customer IDs, a nonclustered index on the relevant foreign key column (e.g., `CustomerID` in the `Invoice` table) is crucial for optimizing join operations and filter conditions, ensuring acceptable performance for the stored procedure when processing many customers.

DA Multiple active -result set(MARS)

Multiple Active Result Sets (MARS) is a feature allowing multiple outstanding data requests on a single connection and is unrelated to defining or passing parameter lists to a stored procedure.

Concept tested: Stored procedure performance with large dynamic lists

Source: https://learn.microsoft.com/en-us/sql/relational-databases/indexes/clustered-and-nonclustered-indexes-described?view=sql-server-ver16

Topics

#Stored procedures#Table-valued parameters#Parameter passing

Community Discussion

No community discussion yet for this question.

Full 70-465 Practice