重新安排SQL 2005中的自动增量

编程入门 行业动态 更新时间:2024-10-17 19:29:20
本文介绍了重新安排SQL 2005中的自动增量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

你好....首先我添加了10个数据,然后我删除了第10个数据,然后又添加了一个订单.订单号未设置id1,2,3,4,5,6,7,8,9,_?_ 11如何重新排列此

hello .... first i added 10 data ,then i deleted order no 10th data,and again i added one order. the order no set id1,2,3,4,5,6,7,8,9,_?_11 how to rearrange this

推荐答案

如果您的列是自动递增即为"Identity",则无法重新排列. 因为它是主要的inseration,所以值不能重复. If your column is Auto incremented that is "Identity" then you can not rearrange it. cause it''s a primary inseration and value can not be repeat.

您可以通过从表中删除该列并重新创建来重新排列. 例如 Hi , You can rearrange by drop the column from table and re creating it. Eg. ALTER TABLE tablename DROP COLUMN columnname alter table tablename add columnname int identity(1,1)

问候, 朋友

regards, Pal

更多推荐

重新安排SQL 2005中的自动增量

本文发布于:2023-07-14 10:04:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1104046.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:增量   SQL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!