SA0049 : Table does not have a clustered index |
![]() |
Define a clustered index on tables to improve data organization and query performance.

In SQL Server, having a clustered index is crucial for performance and data organization. Without a clustered index, the data in a table is stored in a heap, which can lead to inefficient data retrieval and maintenance.
For example:
1-- Example of a table without a clustered index 2CREATE TABLE Employees ( 3 EmployeeID INT, 4 FirstName NVARCHAR(50), 5 LastName NVARCHAR(50) 6);
Tables without a clustered index can lead to problems such as slow query performance because the SQL Server engine must perform an additional step to locate and retrieve the data. Additionally, data modifications like inserts, updates, or deletes can become sluggish as the database grows.
-
Increased search time due to lack of organized data access path.
-
Poor performance for update operations as data pages are not sequentially ordered.
-
Potential lock escalation leading to reduced concurrency for transactions.

Define a clustered index for tables to enhance performance and data organization.
Follow these steps to address the issue:
-
Identify the table that lacks a clustered index and evaluate the column(s) that can serve as the primary candidate for clustering. Columns frequently used in queries or unique columns, like primary keys, are good candidates.
-
Create the clustered index on the selected column(s) using CREATE CLUSTERED INDEX. This can be done in SQL Server Management Studio (SSMS) or via a T-SQL command.
-
Ensure the chosen clustering column(s) support efficient data retrieval and modification by minimizing fragmentation and optimizing data storage.
For example:
1-- Creating a clustered index on the EmployeeID column 2CREATE CLUSTERED INDEX IDX_EmployeeID ON Employees(EmployeeID);

The rule has a ContextOnly scope and is applied only on current server and database schema.

Rule has no parameters.

The rule requires Analysis Context. If context is missing, the rule will be skipped during analysis.


Performance Rules, Bugs

There is no additional info for this rule.
