本文介绍了当数据库引擎用完用于主键的数字时,会发生什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自,可能会用完数量,尤其是如果您没有为该列选择真正大的整数类型。

会发生什么情况以及如何防止它

Since DBs do not reuse numbers of deleted records it is possible to run out of numbers, especially if you pick not really a big integer type for this column.
What would happen and how to prevent it if it's bad?

// SQL Server,MySQL //

// SQL Server, MySQL //

推荐答案

无论发生什么事,它都不会很漂亮。

I think exactly what happens will be dependent on which database engine you're using (there may even be differences between INNODB and MyISAM in MySQL).Whatever happens, it's not going to be pretty.

您只需要将列类型更改为更大的整数即可。

You'd simply have to change the column type to a larger integer.

这篇关于当数据库引擎用完用于主键的数字时,会发生什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-12 10:37