MS SQL Server is giving the following error message on the WITH that preceeds the index options for the dbo.Calendar table: "Incorrect syntax near the word 'WITH'". When the FK declaration is disabled then the error goes away.
CREATE TABLE dbo.Scenario ( ScenarioKey int NOT NULL IDENTITY(1,1), ScenarioName varchar(60) NOT NULL CONSTRAINT [PK-C_dbo.Scenario] PRIMARY KEY CLUSTERED (ScenarioKey) WITH ( PAD_INDEX = OFF, FILLFACTOR = 100, IGNORE_DUP_KEY = OFF, STATISTICS_NORECOMPUTE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON ) ON [PRIMARY] ); GO Works. But the following fails
CREATE TABLE dbo.Calendar ( ScenarioKey int NOT NULL, Bucket smalldatetime NOT NULL, BucketEnd smalldatetime NOT NULL, CONSTRAINT [PK-C_dbo.Calendar] PRIMARY KEY CLUSTERED (ScenarioKey, Bucket), CONSTRAINT [FK_dbo.Calendar_dbo.Scenario] FOREIGN KEY (ScenarioKey) REFERENCES dbo.Scenario (ScenarioKey) ON DELETE CASCADE ON UPDATE CASCADE WITH ( PAD_INDEX = OFF, FILLFACTOR = 100, IGNORE_DUP_KEY = OFF, STATISTICS_NORECOMPUTE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON ) ON [PRIMARY] ); GO What is wrong with the syntax?