Products

Solutions

Learn More

Partners

Community

Blog

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

  • 4/7/2015
  • 8478

8478

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

Last updated 6 years ago

 

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
Subscribe to DNN Digest

DNN Digest is our monthly email newsletter. It highlights news and content from around the DNN ecosystem, such as new modules and themes, messages from leadership, blog posts and notable tweets. Keep your finger on the pulse of the ecosystem by subscribing.  

What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out