2015-10-13 54 views
-1

我在Microsoft Azure上创建了一个SQL Server表。我可以创建新的项目,但是当我尝试删除项目delete from Users where ID = 1我得到错误:Azure无法识别聚簇索引

Tables without a clustered index are not supported in this version of SQL Server. Please create a clustered index and try again.

表是根据下面的语法创建的:

create table Users 
(
    ID int primary key clustered not null identity, 
    FirstName varchar(50) not null, 
    LastName varchar(50) not null, 
) 

用户的ID被用作其他表的外键。

+1

请发布实际的表架构定义('非空'位于错误的地方...)Azure中的所有表都需要聚簇索引 –

回答

0

Users' ID is used as foreign key in other tables.

这些表还需要聚簇索引。

+0

我有一个包含多对多关系的表,并且此表仅包含外键。将主键添加到此表解决了问题。谢谢! – bojo