Core component of SQL Server for storing, processing, and securing data
The | characters in the documentation are placeholders meaning “choose one of these options,” not literal syntax. They must not be included in the T‑SQL statement.
Use a comma‑separated list of options inside WITH (...), for example:
ALTER TABLE [draft].[dbo].[temp2]
ADD CONSTRAINT PK_temp2 PRIMARY KEY (id)
WITH (
FILLFACTOR = 20,
PAD_INDEX = ON,
DATA_COMPRESSION = PAGE
);
Key points:
- Do not use
|in T‑SQL. - Separate multiple index options with commas.
- Give the primary key constraint a name with
CONSTRAINT <name> PRIMARY KEY (...)(recommended and consistent with the documented examples).
References: