数据库表的自动增量功能问题 [英] Problem with Auto Increment feature of database tables

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

问题描述

我有一些数据库表,其中我用一个列''''id''''作为自动增量的主键。我一直在使用表格来访问表格中的数据时遇到问题

 选择 first_name < span class =code-keyword> From  info 其中 id =  1   

。似乎自动增量功能仍然从我清除数据库之前记录的最后一个数字继续。请有人告诉我如何在我清理桌子后重新开始计算。谢谢。

解决方案

在这里你去



如何在SQL Server中重置标识列 [ ^ ]


I have some database tables in which i made a column ''''id'''' a primary key with auto increment. I''ve been running into problems with accessing the data in the tables using say

Select   first_name From info Where id = 1


after clear all records in the table. It seems like the auto increment feature still continues from the last number it recorded before i cleared the database. Please can someone tell me how to make it start afresh to count after i''ve cleared the table. Thanks.

解决方案

Here you go

How to RESET identity columns in SQL Server[^]


这篇关于数据库表的自动增量功能问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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