You should refer to this Transact-SQL Syntax Conventions
The first table in that article explains pretty much everything.
In your example we can see the following:
UPDATE STATISTICS table_or_indexed_view_name
UPDATE STATISTICS is the keyword used table_or_indexed_view_name is the name of the table or the view to update statistics for
[
{
{ index_or_statistics__name }
| ( { index_or_statistics_name } [ ,...n ] )
}
]
This is optional []
, but if supplied, you have to put a statistic name {index_or_statistics__name}
, or |
a list of statistic names separated by commas { index_or_statistics_name } [ ,...n ]
[ WITH
[
FULLSCAN
| SAMPLE number { PERCENT | ROWS }
| RESAMPLE
| <update_stats_stream_option> [ ,...n ]
]
[ [ , ] [ ALL | COLUMNS | INDEX ]
[ [ , ] NORECOMPUTE ]
] ;
This is optional too []
. If used then you must begin with a WITH
and you have 4 options that you must choose from.
Your options are
FULLSCAN
SAMPLE number { PERCENT | ROWS }
, where you have to define thenumber
and you must choose fromPERCENT
or|
ROWS
RESAMPLE
- ` [ ,...n ]' which is a list separated by commas
Then you have to choose either ALL
, COLUMNS
or INDEX
and preside that with a comma if you have used the WITH
.
Lastly you have another option to use the NORECOMPUTE
and put a comma before it if you have used any other option before it.
<update_stats_stream_option> ::=
[ STATS_STREAM = stats_stream ]
[ ROWCOUNT = numeric_constant ]
[ PAGECOUNT = numeric_contant ]
These are the list of predefined options you may use where <update_stats_stream_option>
is used before (in 4).