rowguid作为主键 [英] rowguid as a primary key

查看:136
本文介绍了rowguid作为主键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我像这样创建一个名为rowguid的唯一标识符

i create a unique identifier called rowguid like this

rowguid uniqueidentifier default newsequntialid()





生成唯一的行。使用作为主键生成的行是一个好主意吗?



this generates unique rows. Is it a good idea to use the rows generated as primary key?

推荐答案

根据我的个人经验,我总是喜欢将顺序自动编号作为任何主键的主键。给出表。



函数 newsequntialid()并不能保证guid始终是真正顺序的。请记住,这些都是顺序的,理论上,您最终可能会重复。



此外,请阅读这里更详细的解释
From my personal experience, I always prefer a sequential auto-number as a primary key for any given table.

The function newsequntialid() does not guarantee that the guid is always really sequential. Keep in mind that these are sequential and, in theory, you might also end up with duplicates.

Further more, read here for a more detailed explaination


这篇关于rowguid作为主键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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