SQL Server插入问题

不知道为啥会报错,有谁能解答一下嘛 ==

select * from student  --表中没有空值
select * into test2 from student where 1=2
select * from test2 --复制表的结构,

insert into test2(stid)
select stid from student --这里没有问题

insert into test2(sName)
select sName from student /*---报错:不能将值 NULL 插入列 'cId',表 'CourseAndStudent.dbo.test2';列不允许有 Null 值。INSERT 失败。
语句已终止。*/

我没有插入到CID列啊,插入的不是是Name列嘛?
[这个是我设计的学生表格,然后就………………]SQL Server插入问题_第1张图片
谢谢!!!
鞠躬!!!

你可能感兴趣的:(代码)