alter table stu add ------

来源:百度知道 编辑:UC知道 时间:2024/07/02 18:32:21
增加约束 除了可以增加unique check

identity not null default 可以使用命令增加么? 怎么增加?

当然可以
看例子1:
create table text1
(sid int identity(1,1))
SET IDENTITY_INSERT ON
insert into zz values (1)
select *from zz

看例子2:
create table text2(
id char(10) NOT NULL,
nname char(20) NOT NULL,
price money default 0.01)

Alter TABLE 表 ADD 编号1 bigint identity(1,1)not null