Error while creating Index

  • hi All

    I'm getting error when I'm trying to create a nonclustered index on a column.

     

    Index 'indPAN' was not created. This index has a key length of at least 1000 bytes. The maximum permissible key length is 900 bytes.

  • The error message is very clear. It's not allowed to create an index if the length of all the columns in the index exceeds 900bytes

     

  • So you want to say that if the column on which I'm creating the index has a length of char(1000) then I cannot create an index on this.

  •  

    an index on a char(1000) column??? --> NO

    varchar(1000)? --> YES you can with a warning....... becareful!! 

    it's play and learn time now.... go see what happens if you create an index on varchar(1000) column and then try to insert/update that column a length of 899, 900, 901,1000 and see what happens.

  • If you create index on column varchar(1000), you can never insert data to that column bigger than 900 bytes becuase this will break the index. You will get an error (insertion will fail).

     

     

  • c'mon.... you destroyed his play and learn time....

  • HI

    Well tx a lot for those responses. i created an index on a varchar(1000) column and it was created but with a warning.After this I was able to insert data till 900 but after that it gave error and could not insert the data.

    Well tx a lot.

     

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply