Updates statistics that are stored in systabstats table, such as rowcount, cluster ratios, and so on. Does not affect column statistics stored in sysstatistics.
update table statistics table_name [partition data_partition_name] [index_name [partition index_partition_name]]
update table statistics titles partition smallsales
update table statistics titles
update table statistics does not update statistics for index partitions. To generate table-level statistics for index partitions, use update statistics.
Because running update table statistics incurs the I/O cost of running update statistics, use update statistics to generate both column and table statistics.
You can create, and then drop, a global index to generate global statistics.
When you run update statistics on a single partition, you create global statistics by merging partition statistics. However, these merged global statistics are less accurate than the global statistics created as a side-effect of global index creation. Avoid generating column statistics that overwrite more accurate, earlier versions of column statistics.
index_name – update table statistics updates statistics for all the index partitions of the index.
index_partition – update table statistics updates statistics for the specific index partition.
See also Performance and Tuning Guide.
ANSI SQL – Compliance level: Transact-SQL extension.
You must be the table owner or a user with update statistics permission on the table to run update table statistics.