Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
SQL Server 2016 and Azure SQL Database have increased the maximum size for index keys with nonclustered indexes. The new maximum key size for nonclustered indexes is 1700 bytes. The maximum key size for clustered indexes remains 900 bytes.
Consider, for example, the following script which creates a table with a 1700 byte variable-length character column, creates an index on that column, and inserts a 1700-byte value in the column.
DROP TABLE IF EXISTS dbo.t1
GO
CREATE TABLE dbo.t1
( c1 VARCHAR(1700)
)
GO
CREATE INDEX ix_c1 ON dbo.t1(c1)
GO
INSERT t1 VALUES (REPLICATE('1', 1700))
GO
This script succeeds in SQL Server 2016 and Azure SQL Database. In earlier versions of SQL Server the CREATE INDEX statement would give a warning, and the INSERT statement would fail.
For more details see the Maximum Capacity Specification for SQL Server.
Two notes about columnstore indexes and memory-optimized tables:
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in