We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如果不记录Sequences的话,也可以使用 ABS(CHECKSUM(NEWID())) 来尽可能保证其随机性,当然这并不能保证不会重复。 在我机器上运行了sql脚本使用rand()的方式基本上20多条就会产生重复,使用ABS(CHECKSUM(NEWID()))的话测试了10W条未产生重复值,大概在50多w的时候发生了重复。 当然相比而言ABS(CHECKSUM(NEWID()))的生成速度要比rand()慢一些,本地循环生成10W条大概在5s左右
ABS(CHECKSUM(NEWID()))
The text was updated successfully, but these errors were encountered:
方法不错,值得采纳。
Sorry, something went wrong.
No branches or pull requests
如果不记录Sequences的话,也可以使用
ABS(CHECKSUM(NEWID()))
来尽可能保证其随机性,当然这并不能保证不会重复。
在我机器上运行了sql脚本使用rand()的方式基本上20多条就会产生重复,使用ABS(CHECKSUM(NEWID()))的话测试了10W条未产生重复值,大概在50多w的时候发生了重复。
当然相比而言ABS(CHECKSUM(NEWID()))的生成速度要比rand()慢一些,本地循环生成10W条大概在5s左右
The text was updated successfully, but these errors were encountered: