nerdexam
CompTIA

DS0-001 · Question #100

Which of the following commands when executed will rebuild statistics against user-defined tables in a database?

The correct answer is B. sp_updatestats. sp_updatestats rebuilds statistics for all user-defined tables in the current database by calling UPDATE STATISTICS for each table that has had data modifications since statistics were last updated - making it the right tool for a broad, database-wide statistics refresh. Why…

Database Management and Maintenance

Question

Which of the following commands when executed will rebuild statistics against user-defined tables in a database?

Options

  • Asp_autostats
  • Bsp_updatestats
  • CDBCC UPDATEUSAGE
  • DDBCC SHOW_STATISTICS

How the community answered

(36 responses)
  • A
    3% (1)
  • B
    89% (32)
  • C
    6% (2)
  • D
    3% (1)

Explanation

sp_updatestats rebuilds statistics for all user-defined tables in the current database by calling UPDATE STATISTICS for each table that has had data modifications since statistics were last updated - making it the right tool for a broad, database-wide statistics refresh.

Why the distractors are wrong:

  • A. sp_autostats - Displays or changes the auto-update statistics setting for individual tables/indexes; it configures behavior, not executes a rebuild.
  • C. DBCC UPDATEUSAGE - Corrects inaccuracies in sys.allocation_units (page and row count metadata), not statistics used by the query optimizer.
  • D. DBCC SHOW_STATISTICS - Reads and displays current statistics for a table and index; it's a diagnostic/read command, not an update command.

Memory tip: Think of the word "update" - sp_updatestats literally has "update" and "stats" in its name, signaling its purpose. The DBCC commands are diagnostic tools (show or fix metadata), while sp_autostats is about settings, not execution.

Topics

#SQL Server statistics#Database maintenance#sp_updatestats

Community Discussion

No community discussion yet for this question.

Full DS0-001 Practice