SQL数据库中的自动增量列 [英] autoincrement column in SQL database

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

问题描述

我在数据库的一个表中有两个值,需要自动递增. 第一个值是ID,它是主要值,它被设置为身份列",并且在属性中具有("Is Identity"(身份))-"Yes"(是). 以及如何将我的第二个值(数字)设置为自动递增.当我设置他的属性(身份)时,会自动将身份列更改为数字.

I have two value in one table in database which I need to autoincrement. First value is ID it's a primary kay and it is setup as Identity Column and have (Is Identity) - Yes in properties. And how setup my second value (number) to autoincrement. When I setup his property (Is Identity) yes it automaticly change Identity Column for number.

是否可以在sql的一个表中使两个值自动递增?

Is possible to meke autoincrement for two value in one table in sql?

推荐答案

一个表中不能有多个标识列(无论如何我都想不出这样做的正当理由).

It is not possible to have more than one identity column in a table (and I can't think of a valid reason for wanting to do so anyhow).

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

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