2021年10月1日 星期五

Msg 666 The maximum system-generated unique value for a duplicate group was exceeded for index with partition ID xxxxxx. Dropping and re-creating the index may resolve this; otherwise, use another clustering key

 

Msg 666, Level 16, State 2, Line 2

The maximum system-generated unique value for a duplicate group was exceeded for index with partition ID 422920200585216. Dropping and re-creating the index may resolve this; otherwise, use another clustering key.



建立table時沒有指定一個Key欄位並且設定為UNIQUE 或 建立Clustered index沒有設定為UNIQUE ,此時SQL Server會自動在這個該table增加一個隱藏的4-byte UNIQUIFIER欄位,當寫入資料有重複時會在UNIQUIFIER欄位給予一個UNIQUE值,該值最高可以給到  2147483648 (21億個),當重複資料的狀況超過這個數字就會以下錯誤訊息

The maximum system-generated unique value for a duplicate group was exceeded for index with partition ID 422468691427328. Dropping and re-creating the index may resolve this; otherwise, use another clustering key


解決方法:
建議的解決方法是,當資料會有重複的狀況,建立TABLE時應該要指定一個Key 欄位並且設定為UNIQUE



Reference:

The maximum system-generated unique value for a duplicate group was exceeded for index with partition ID %I64d. Dropping and re-creating the index may resolve this; otherwise, use another clustering key

http://sqlserverbuddy.blogspot.com/2020/08/the-maximum-system-generated-unique.html

Uniqueifier considerations and error 666

https://techcommunity.microsoft.com/t5/sql-server-support/uniqueifier-considerations-and-error-666/ba-p/319096


Having fun with maxed out uniqifiers on a non unique clustered index

http://sqlservercode.blogspot.com/2017/06/having-fun-with-maxed-out-uniqifiers-on.html






沒有留言:

SQL Server Planning, Pricing and License

  Server-CALs授權模式 1.需購買的量應該是所有終端用戶的電腦 例如:一台Data warehouse主機 與 一台Web報表主機,但公司有50人或電腦會連進Web報表主機開啟報表,則應該每一台用戶端電腦都需要有CALs授權,Data warehouse主機購買Ser...