nerdexam
Microsoft

70-465 · Question #71

You need to recommend a solution to minimize the amount of time it takes to execute USP_2. What should you recommend?

The correct answer is C. A temporary table. To minimize execution time of a stored procedure (USP_2), using a temporary table allows intermediate results to be stored, indexed, and reused efficiently within the session.

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

Question

You need to recommend a solution to minimize the amount of time it takes to execute USP_2. What should you recommend?

Options

  • AA database snapshot
  • BA table variable
  • CA temporary table
  • DSnapshot isolation

How the community answered

(49 responses)
  • A
    6% (3)
  • B
    4% (2)
  • C
    80% (39)
  • D
    10% (5)

Why each option

To minimize execution time of a stored procedure (USP_2), using a temporary table allows intermediate results to be stored, indexed, and reused efficiently within the session.

AA database snapshot

A database snapshot provides a read-consistent point-in-time view of a database for reporting or recovery purposes, but it does not optimize the internal execution of a stored procedure.

BA table variable

A table variable stores data in memory-scoped to a batch or procedure, but it does not maintain statistics and is treated as having a single-row estimate by the query optimizer, which can lead to poor execution plans on larger datasets compared to temporary tables.

CA temporary tableCorrect

Temporary tables (created with #tablename) are stored in tempdb and support indexes, statistics, and multiple references within a stored procedure, which can significantly reduce execution time by allowing the query optimizer to use better execution plans. Unlike table variables, temp tables allow statistics to be gathered, enabling more efficient joins and filtering on large datasets. This makes them ideal for breaking complex queries into optimized steps within a stored procedure like USP_2.

DSnapshot isolation

Snapshot isolation is a transaction isolation level that reduces blocking by using row versioning, but it does not directly improve the execution performance or speed of a stored procedure's query logic.

Concept tested: Optimizing stored procedure performance using temporary tables

Source: https://learn.microsoft.com/en-us/sql/t-sql/statements/create-table-transact-sql?view=sql-server-ver16#temporary-tables

Topics

#T-SQL performance#Temporary tables#Stored procedure optimization

Community Discussion

No community discussion yet for this question.

Full 70-465 Practice