ahmed elbarbary

ahmed elbarbary

  • NA
  • 1.6k
  • 275.2k

error The index entry of length 1890 bytes for the index 'IDX_EStrat'

Nov 25 2021 6:48 PM

i have table create index on it
but it give me error

so how to solve it please

 

CREATE TABLE [dbo].[TGen](
     [TradeCodeControlID] [int] IDENTITY(1,1) NOT NULL,
     [ZfeatureType] [nvarchar](200) NULL,
     [EStrat] [nvarchar](2500) NULL,
     [EEnd] [nvarchar](2500) NULL
 ) ON [PRIMARY]
    
 GO
 CREATE NONCLUSTERED INDEX IDX_EStrat ON ExtractReports.dbo.TGen(EStrat);


 Warning! The maximum key length for a nonclustered index is 1700 bytes. The index 'IDX_EStrat' has maximum length of 5000 bytes. For some combination of large values, the insert/update operation will fail.
 Msg 1946, Level 16, State 3, Procedure dbo.SP_TradeCodeGenerateByProduct, Line 403
 Operation failed. The index entry of length 1890 bytes for the index 'IDX_EStrat' exceeds the maximum length of 1700 bytes for nonclustered indexes.

so how to solve error above please
and why this error display


Answers (1)