What is the total character limit for a 900 byte index limit that SQL Server 2012 has. I created a column that has varchar(2000), but I think that it exceeding the 900 byte that SQL Server limited? What would be a max varchar(?) to fit inside the 900 byte index column?
What is the total character limit for a 900 byte index limit that SQL
Share
The storage size for varchar is the actual length of the data entered + 2 bytes. Even though the column itself has that 2 byte overhead, you can put up to 900 byte varchar values into a column which is indexed.
In practice, you can create an index on a column larger than 900 bytes in size, but you will have a problem if you actually try to insert something larger than 900 bytes:
Be aware that the 900-byte limit includes all columns of a given index key, as this example shows:
For these columns that are normally too large for an index key, you may be able to gain some benefits of indexing by including them in an index.