我正在一个表上创建一个聚集索引,抛出以下错误 [英] i am creating a clustered index on one table which is throwing the below errors

查看:110
本文介绍了我正在一个表上创建一个聚集索引,抛出以下错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



i我在表格的两列上创建一个聚集索引,这会导致错误。



'Core.cdiConstraints'表中的'DropConstraint'列的类型无法用作索引中的键列。

警告!最大密钥长度为900字节。索引'StudyAmendmentIndex'的最大长度为1020个字节。对于某些大值的组合,插入/更新操作将失败。





表结构

column1 DropConstraint(varchar(max),notnull)

column2 AddConstraint(varchar(max),notnull)



请建议我如何避免在列上创建聚簇索引时出错。


i am creating a clustered index on two columns of the table which is throwing below error.

Column 'DropConstraint' in table 'Core.cdiConstraints' is of a type that is invalid for use as a key column in an index.
Warning! The maximum key length is 900 bytes. The index 'StudyAmendmentIndex' has maximum length of 1020 bytes. For some combination of large values, the insert/update operation will fail.


table structure
column1 DropConstraint (varchar(max),notnull)
column2 AddConstraint(varchar(max),notnull)

Please suggest me how to avoid the errors while creating the clustered indexes on both the column.

推荐答案





请不要在创建clustured index之前,SQL Server有限制创建clustured index



对于组合索引值的最大允许大小,900字节限制



意味着您所拥有的索引值不应超过900字节的限制。



但是你要分配它varchar(Max) ...请加以限制。



希望这个建议对你有用。
Hi,

Please make a not before crearting clustured index as SQL server has limitation to create clustured index that

"900 byte limit for maximum allowable size of the combined index values"

Means You clustured index vlaue should not go beyond this limit of 900 bytes.

But you are assigning it Varchar(Max)... Please make it upto some limit.

hope this suggetion work for you.


这篇关于我正在一个表上创建一个聚集索引,抛出以下错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆