自己测试下不就知道了??
create table test123(
id int,
id2 int,
primary key(id,id2)
)
insert into test123 (id) values(23)
消息 515,级别 16,状态 2,第 2 行
不能将值 NULL 插入列 'id2',表 'ztx.dbo.test123';列不允许有空值。INSERT 失败。
语句已终止。
insert into test123 (id,id2) values(23,34)
(1 行受影响)
事实证明:主键的值不能为空!
温馨提示:答案为网友推荐,仅供参考