Warning! The maximum key length is %d bytes. The index '%.*ls' has maximum length of %d bytes. For some combination of large values, the insert/update operation will fail.

Error Message:
Warning! The maximum key length is %d bytes. The index ‘%.*ls’ has maximum length of %d bytes. For some combination of large values, the insert/update operation will fail.
Warning! The maximum key length is %d bytes. The index ‘%.*ls’ has maximum length of %d bytes. For some combination of large values, the insert/update operation will fail.

Severity level:
10.

Description:
This informational error message appears when you try to create an index with with a key length larger than the allowed maximum of 900 bytes.

Consequences:

Resolution:
Error of this severity level are informational errors that do not have an effect on the statement. However, you should consider changing the index definition.

Versions:
All versions of SQL Server.

Example(s):
IF OBJECT_ID (‘dbo.t’) IS NOT NULL
    DROP TABLE dbo.t;
GO

CREATE TABLE dbo.t
(
    c1 varchar(1000) PRIMARY KEY
);

Remarks:
In the above example we try to create an index on a varchar(1000) column. This raises the error.

]]>

Leave a comment

Your email address will not be published.