mirror of
https://github.com/Microsoft/sql-server-samples.git
synced 2025-12-08 14:58:54 +00:00
14 lines
469 B
Transact-SQL
14 lines
469 B
Transact-SQL
-- ======================================
|
|
-- Create Sampled Statistics Template
|
|
-- ======================================
|
|
CREATE STATISTICS <statistics_name, sysname, statistics_name>
|
|
ON <schema_name, sysname, schema_name>.<table_name, sysname, table_name>
|
|
(
|
|
<column_name1, sysname, column1>,
|
|
<column_name2, sysname, column2>
|
|
)
|
|
WITH SAMPLE <percent_value, int, 100> PERCENT;
|
|
GO
|
|
-- Instead of PERCENT, you can say ROWS to specify the number of rows to sample.
|
|
|