MS SQL自动增量列 [英] MS SQL Auto increment column

查看:85
本文介绍了MS SQL自动增量列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在使用SQL2000。在我的表中有一个自动增量的列。现在的情况是自动增量数据,如1,2,3,4,5现在我想再次从3,4,5开始,数据将会像1,2,3,4,5,3,4,5一样怎么可能在SQL2000中。





谢谢和问候

Indrajit Dasgupta

Hi All,
I am working with SQL2000. In my table there is a column with auto increment. Now scenario is that auto increment data like 1,2,3,4,5 now I want to again start from 3,4,5 that is data will come like 1,2,3,4,5,3,4,5 How can it is possible in SQL2000.


Thanks & Regards
Indrajit Dasgupta

推荐答案

你为什么要那样?如果你选择这种方式,你就无法停在你想要的地方。

更好的方法是手动操作,比如使用基于数据引用的逻辑。



如果您仍想按照自己的方式行事,请查看此提示/技巧

重置表格标识 [ ^ ]
Why do you want that way? If you choose that way, you can't stop where you want.
Better way is do it manually like using some logic based on reference of your data.

If still you want to go with your way, check this Tip/Trick
Reset Table Identity[^]


这篇关于MS SQL自动增量列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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