简体   繁体   中英

Does it matter if I index a column > 900 bytes

So SQL server places a limit of 900 bytes on an index. I have columns that are NVARCHAR(1000) that I need to search on. Full text search of these columns is not required because search will always occur on the complete value or a prefix of the complete value. I will never need to search for terms that lie in the middle/end of the value.

The rows of the tables in question will never be updated predicated on this index, and the actual values that exceed 450 chars are outliers that will never be searched for.

Given the above, is there any reason not to ignore the warning:

The total size of an index or primary key cannot exceed 900 bytes

?

We shouldn't ignore the warning as any subsequent INSERT or UPDATE statement that specifies data values that generates a key value longer than 900 bytes will fail. Following link might help: http://decipherinfosys.wordpress.com/2007/11/06/the-900-byte-index-limitation-in-sql-server/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM