Products

Solutions

Resources

Partners

Community

About

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Clustered indexes are required for inserting data in this version of SQL Server

Return to previous page

  • 4/7/2015
  • 14193 Views

Comments

14193 Views

Clustered indexes are required for inserting data in this version of SQL Server

Last updated long time ago

Comments

Common

(Enter the content of this article below)

Advanced

 

Error

Table: [XXX] does not have a clustered index. Clustered indexes are required for inserting data in this version of SQL Server.

Cause

SQL Azure needs at least one clustered index per table in order to maintain the other two replicas that are created out of the box for all databases. You can create a table without the clustered index, but if you try to do any CRUD operation this error will be thrown.

Fix

Create a clustered index for the table. Recommendations:

1) If the table has a column with IsIdentity=true, create a clustered index by that column (normally will be the PK)

2) If the table does not have a column with IsIdentity=true, to ensure the maximum compatibility with current code just create a column RowId with IsIdentity=true and the clustered index on it:

ALTER TABLE [XXX] ADD

RowId int NOT NULL IDENTITY (1, 1) PRIMARY KEY CLUSTERED
GO

Part of the SQL Azure Compatibility Centre
Contents
No sections defined
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out