我想以sql中的修复数字的方式生成一个auto_id列。 [英] i want to generate a auto_id column in the manner of fix digits in sql ..
本文介绍了我想以sql中的修复数字的方式生成一个auto_id列。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好..
i希望以固定数字的方式在我的sql中生成一个auto_id列,我解释了U ... for ex ..
auti_id从1到999 ...
比这样来......
hello all..
i want to generate a auto_id column in my sql in the manner of fix digit , i explain U...for ex ..
auti_id from 1 to 999...
than it come in this way...
001
002
003
004
...
009
..
099
..
999
请问我不知道如何实现这个目标..
任何想法请...
pls i have no idea how to acheive this ..
any idea pls...
推荐答案
这是个坏主意!
请,阅读身份 [ ^ ]和创建和修改主键 [ ^ ]。
但如果您仍想以所需格式创建auto_id
,请参阅: http://www.dotnetfunda.com/codes/code2633-how-to-auto-increment-something-like-c001c002c003.aspx 一> [ ^ ]
自动生成序列SQL Server中的数字 [ ^ ]
It''s bad idea!
Please, read about Identity[^] and Creating and modifying primary key[^].
But if you still want to createauto_id
in desired format, please see this: http://www.dotnetfunda.com/codes/code2633-how-to-auto-increment-something-like-c001c002c003.aspx[^]
Auto generated sequence number in SQL Server[^]
这篇关于我想以sql中的修复数字的方式生成一个auto_id列。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文