且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

是否可以为sql server/MSSQL中的主键生成唯一值

更新时间:2023-09-22 22:22:58

***将主键定义为输入性能,然后以您需要向用户显示的格式创建可读性更高"的列.



另请阅读: http://***.com/questions/4821831/sql-server-generate-primary-key-based-on-counter-and-another-column-value [
It is better to define your primary keys as integer type for performance and create a "more readable" column in the format your require to show to your users.



Read this also : http://***.com/questions/4821831/sql-server-generate-primary-key-based-on-counter-and-another-column-value[^]


我认为您的问题将通过计算字段解决,并且您的问题与该人非常相似:

自动编号请帮助 [
I think your problem will be solved by computed fields , and your problem is very similar to this person :

Auto Number pls help[^]

Hope it helps.