Invalid option specified in CREATE INDEX statement

2019-08-28 09:01发布

问题:

I'm trying to create a table which should ignore any duplicate value, using SQLCE. To do this, I figured I would select a column to be the index and use the IGNORE_DUP_KEYoption. When I run the code below:

CREATE NONCLUSTERED INDEX url_index ON Person (url ASC) WITH (IGNORE_DUP_KEY=ON)

I get an error message saying "Invalid option specified in CREATE INDEX statement. [option name = IGNORE_DUP_KEY]."

Is this because I'm using SQLCE? If so, how can I ignore duplicates in SQLCE?

回答1:

The only valid with statement for CREATE INDEX in SQL Server CE is STATISTICS_NORECOMPUTE.