增加约束 除了可以增加unique check
identity not null default 可以使用命令增加么? 怎么增加?
alter table stu add ------
答案:2 悬赏:20
解决时间 2021-12-22 09:24
- 提问者网友:温柔又任性
- 2021-12-21 21:01
最佳答案
- 二级知识专家网友:懂得ㄋ、沉默
- 2021-12-21 22:28
当然可以
看例子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)
看例子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)
全部回答
- 1楼网友:我叫很个性
- 2021-12-21 23:12
试试这个:alter table student add constraint stu_name check (name is not null);
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯