Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 在文件组上创建新的群集表_Sql_Sql Server_Tsql_Ssms - Fatal编程技术网

Sql 在文件组上创建新的群集表

Sql 在文件组上创建新的群集表,sql,sql-server,tsql,ssms,Sql,Sql Server,Tsql,Ssms,我一直收到一条错误消息,错误的语法就在附近。有人能帮我找出原因吗 CREATE TABLE [CustomerService.Contacts] ( --A ContactID int IDENTITY(1,1), CONSTRAINT PK_ContactID PRIMARY KEY CLUSTERED (ContactID), --B CustomerID int not null,

我一直收到一条错误消息,错误的语法就在附近。有人能帮我找出原因吗

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

您从未关闭在第一行之后打开的括号:

CREATE TABLE [CustomerService.Contacts]

(
因此,在ON关键字之前可能缺少一个右括号:


这在MySQL上不起作用,因为它看起来像MSSQL。您真正使用的是什么?Microsoft SQL server管理请相应地更正标记。
...
        ContactDetail varchar(MAX) not null,

        )  -- <---this was missing

ON  AD_CustomerService;

GO

ALTER TABLE CustomerService.Contacts

REBUILD PARTITION = ALL WITH (DATA_COMPRESSION = PAGE);

GO