Error 1903

Troubleshooting SQL Server

Troubleshooting

Error 1903

Severity Level 16
Message Text

Index keys are too large. The %d bytes needed to represent the keys for index %d exceeds the size limit of %d bytes.

Explanation

This error occurs when the sum of the lengths of the columns that make up the composite index exceeds 900 bytes.

A composite index is an index that uses from 2 to 16 columns. For example, the following shows a composite index using objects from the Northwind database:

USE Northwind
GO
CREATE INDEX CompanyNameCity
ON Customers (CompanyName, City)
GO

In this example, CompanyName is defined as nvarchar(40) and City as nvarchar(15). Each character requires 2 bytes of storage, so the total length of this composite index is 110 bytes (2* (40 + 15)). Note that when using varchar columns, the index will assume the maximum length of the varchar column to calculate the length of the composite index.

Action

Examine the lengths of the columns in your composite index and make sure that the total does not exceed 900 bytes. For more information about determining the storage size for different Microsoft® SQL Server™ data types, see the Data Types topic, and for more information about indexes, see the CREATE INDEX and Creating an Index.

See Also

Errors 1000 - 1999