表a有两个字段,id1,id2。其中id2是timestamp类型。
当从b表选择数据插入到到a表时:
insert into a
select b.id,cast(getdate() as timestamp) from b
总是报错,不能在 timestamp 列中插入非空值。请使用带有列的列表,或 timestamp 列默认值为 NULL 的 INSERT 语句。

insert into a
select b.id,''  from b
出错提示:不允许从数据类型 varchar 到数据类型 timestamp 的隐性转换(表 'tmyjx.dbo.ICStockBill',列 'FOperDate')。请使用 CONVERT 函数来运行此查询。