根据MSDN,他们将System.Guid.NewGuid()描述为..
The chance that the value of the new Guid will be all zeros or equal to any other Guid is very **low**将Customer表的唯一标识符设置为“customerID”并使用System.Guid.NewGuid()生成唯一的id是不是一个好主意?如何确保该方法只生成唯一的ID?
发布于 2011-06-03 19:26:48
除非您有很好的理由使用Guid作为ID,否则我建议不要使用Guid作为键。Guids在数据库中占用大量空间,并且在常见情况下没有提供任何好处。另外,它们不能很好地处理索引。
为什么不将CustomerID设置为整数,并将其设置为在插入新记录时自动生成值?
https://stackoverflow.com/questions/6226212
复制相似问题