我经常收到一条错误消息,语法不正确 ON
. 有人能帮我找出原因吗?
CREATE TABLE [CustomerService.Contacts]
(
--A
ContactID int IDENTITY(1,1),
CONSTRAINT PK_ContactID PRIMARY KEY CLUSTERED (ContactID),
--B
CustomerID int not null,
CONSTRAINT FK_CustomerID FOREIGN KEY (CustomerID)
REFERENCES Sales.Customer (CustomerID),
--C
RepID int not null,
CONSTRAINT FK_RepID FOREIGN KEY (RepID)
REFERENCES CustomerService.Reps (RepID),
--D
ContactDateTime date not null,
--E
ContactMethod varchar(5) DEFAULT 'Other' not null,
CHECK (ContactMethod IN ('Email', 'Phone', 'Chat', 'Other')),
--F
ContactPhone varchar(14) null,
--G
ContactEmail varchar(50) null,
--H
ContactDetail varchar(MAX) not null,
ON AD_CustomerService;
GO
ALTER TABLE CustomerService.Contacts
REBUILD PARTITION = ALL WITH (DATA_COMPRESSION = PAGE);
GO
1条答案
按热度按时间nle07wnf1#
您从未关闭在第一行之后打开的括号:
所以在
ON
关键字: