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

Return to previous page

  • 4/7/2015
  • 5203 Views

Comments

5203 Views

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

Last updated 4 years 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
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.  


Copyright 2017 by DNN Corp Terms of Use Privacy
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out