简单问题,请您回答!
在SQL-Server中如何实现某一字段自动编号 问题点数:20、回复次数:7Top
1 楼firetoucher(风焱)回复于 2003-08-02 09:39:46 得分 5
用列的identity属性
create a
(b int identity(1,1))Top
2 楼happydreamer(www.sz.js.cn,www.gyxk.com)回复于 2003-08-02 09:52:43 得分 5
alter table tbname add id int identity(1,1)Top
3 楼txlicenhe(马可)回复于 2003-08-02 11:00:58 得分 3
alter table yourTableName alter column id int identity(1,1)
Top
4 楼qianguob(不懂编程)回复于 2003-08-02 14:39:03 得分 3
SELECT IDENTITY(int, 1,1) AS ID_Num
from tableTop
5 楼zjcxc(邹建)回复于 2003-08-02 22:58:57 得分 2
用identity
在企业管理器中设计表,选择字段类型为数字型,在字段属性中,设置"标识字段"的值为"是"
Top
6 楼zjcxc(邹建)回复于 2003-08-02 23:00:07 得分 2
用SQL语句:
--创建带标识字段的表
create talbe 表(标识字段名 int identity(1,1))
--为已经存在的表增加标识字段:
alter talbe 表 add 标识字段名 int identity(1,1)Top



