如何在MSSQL中创建自动编号
ft 问题点数:20、回复次数:5Top
1 楼ys497(明尔)回复于 2003-02-03 22:43:06 得分 4
tb:新表名
f1:字段名1为自动编号
f2:字段名2为字符型,且长度为5
f3:字段名3为整数型
f4:字段名4为双精度型
f5:字段名5为图形等文件型
create table tb (f1 counter,f2 text(5),f3 int,f4 double,f5 image)Top
2 楼ys497(明尔)回复于 2003-02-03 22:44:29 得分 4
tb:新表名
f1:字段名1为自动编号
f2:字段名2为字符型,且长度为5
f3:字段名3为整数型
f4:字段名4为双精度型
f5:字段名5为图形等文件型
create table tb (f1 counter,f2 text(5),f3 int,f4 double,f5 image)
Top
3 楼happydreamer(www.sz.js.cn,www.gyxk.com)回复于 2003-02-03 23:04:04 得分 4
create table tb(f1 int identity,f2 ...,f3....)Top
4 楼wancyang(I++)回复于 2003-02-03 23:24:21 得分 4
identity(1,1)
identity的字段应为数字类型Top
5 楼earthpea(问莲根,有丝多少?莲心知为谁苦?)回复于 2003-02-04 12:27:40 得分 4
我的一个表的片断:
create table notice
(id int identity not null primary key,
ip char(15) not null,
………………
content ntext not null);
id字段就是自动编号的
Top




