我有两张表,news和news_info
其中news中有四个字段id title content time,其中id是主键就是序号,content的数据类型是ntexet,time是时间类型,title是字符类型
另一张表news_info同样有上面几个字段数据类型也相同,现在多了一个字段是userid且不能为空.我用
insert into news_info(content)
select content
from news
时他提示不能将空值插入userid
我想问我用什么办法才能将这列数据插入,不会出错,ntext的类型异常怎么解决?
谢谢啊!
其中news中有四个字段id title content time,其中id是主键就是序号,content的数据类型是ntexet,time是时间类型,title是字符类型
另一张表news_info同样有上面几个字段数据类型也相同,现在多了一个字段是userid且不能为空.我用
insert into news_info(content)
select content
from news
时他提示不能将空值插入userid
我想问我用什么办法才能将这列数据插入,不会出错,ntext的类型异常怎么解决?
谢谢啊!
或者给他一个默认值
select content,55
from news
select content,'随便给一个默认值'
from news
除非如前面所說的,隨便給一個值.
或者把userid設置成允許為空