SQL表中的自增主键 [英] Auto-increment primary key in SQL tables

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

问题描述

使用 Sql Express Management Studio 2008 GUI(不带编码),如何使主键自动递增?

Using Sql Express Management Studio 2008 GUI (not with coding), how can I make a primary key auto-incremented?

让我解释一下:有一个表,有一个名为id"的列,该列的项目设置为主键.我想让此列自动递增,但如何?

Let me explain: there is a table which has a column named "id" and the items of this column are set to be primary keys. I want to make this column auto-incremented, but how?

干杯

推荐答案

  1. 想必您正在设计桌子.如果不是:右键单击表名称 - 设计".
  2. 点击所需的列.
  3. 列属性"(底部)中,滚动到身份规范"部分,将其展开,然后切换(是身份)"" 到 "".
  1. Presumably you are in the design of the table. If not: right click the table name - "Design".
  2. Click the required column.
  3. In "Column properties" (at the bottom), scroll to the "Identity Specification" section, expand it, then toggle "(Is Identity)" to "Yes".

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

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