如何在 PRIMARY 文件组上创建索引?

How can i create an index on the PRIMARY filegroup?

CREATE NONCLUSTERED INDEX index
ON table (column1)
INCLUDE (column2, column3) ON ????;

table 被划分为 3 个文件组 我想创建物理存储在 PRIMARY 文件组中的索引 我该怎么做?

您的语法是正确的 - 但是您只需要使用 [] 转义 PRIMARY,即:

CREATE NONCLUSTERED INDEX IX1
ON table (column1)
INCLUDE (column2, column3) 
ON [PRIMARY];

如果您要移动现有索引,则需要 drop the existing one:

CREATE NONCLUSTERED INDEX IX1
ON table (column1)
INCLUDE (column2, column3) 
WITH (DROP_EXISTING = ON)
ON [PRIMARY];