2015-10-13 56 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