1、SQL SERVER企业管理器-->右键你的表-->设计表-->选中你要设置标识的字段(必须是int类型)-->下面有个属性叫“标识”的,选“是”,你可以按你的要求改一下标识种子或标识递增量,然后保存该表的设计。 或 create table aa(id int identity(1,1),F1 varchar(20)) 或 alter table bb add id int identity(1,1)
1: id int identity(1,1)
id int identity(1,1) ASA是什么,请教
1、CREATE TABLE ID INT IDENTITY(1,1) 2、khjg as 考核结果表
select * from tablename a a是tablename的别名
TO 平平淡淡:第一个问题解决了,但第二个问题还不行。AS 子句好象用来更改结果集列名或为导出列指定名称,而不能为一张表指定名称吧。 我要建的表是: create table khjg ( id integer not null identity(1,1) , -- 考核批次 sfzh varchar(18) not null , -- 身份证号 jfje decimal(10,2) , -- 奖罚金额,正数表 --示奖励,负数表示惩罚 khyf datetime , -- 考核月份 bz varchar(300) , -- 说明 primary key(id,sfzh) , foreign key(sfzh) references zy(sfzh) on update cascade on delete no action ); --comment on table khjg is '考核结果'; 请问如何表示khjg这张表是‘考核结果表'
或
create table aa(id int identity(1,1),F1 varchar(20))
或
alter table bb add id int identity(1,1)
ASA是什么,请教
2、khjg as 考核结果表
a是tablename的别名
我要建的表是:
create table khjg
(
id integer not null identity(1,1) , -- 考核批次
sfzh varchar(18) not null , -- 身份证号
jfje decimal(10,2) , -- 奖罚金额,正数表
--示奖励,负数表示惩罚
khyf datetime , -- 考核月份
bz varchar(300) , -- 说明
primary key(id,sfzh) ,
foreign key(sfzh) references zy(sfzh) on update cascade on delete no action
);
--comment on table khjg is '考核结果';
请问如何表示khjg这张表是‘考核结果表'