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…
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)- A3% (1)
- B89% (32)
- C6% (2)
- D3% (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 insys.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
Community Discussion
No community discussion yet for this question.