CREATE STATISTICS (SQL Server Compact)
Creates a histogram (a bar chart) of the supplied table and index or indices.
Specifies the name of the table to create the statistics on.
The index to create the statistics on. If no index is specified, the statistics are created for all indexes in the table.
Specifies that all rows in the table or view should be read to gather the statistics.
Specifies that automatic recomputation of the statistics should be disabled. If this option is specified, the Database Engine continues to use old statistics even as the data changes. The statistics are not automatically updated and maintained by the Database Engine, which can produce suboptimal plans.
Important We recommend that this option be used rarely, and only by a trained system administrator.
The following example creates a histogram of the MyCustomers table and index.
CREATE TABLE MyCustomers (CustID int, CompanyName nvarchar(50)); CREATE UNIQUE INDEX idxCustId ON MyCustomers (CustId); DROP STATISTICS ON MyCustomers.idxCustId; CREATE STATISTICS ON MyCustomers.idxCustId WITH FULLSCAN, NORECOMPUTE;