insert a(col1,col2,不要标识字段) 
select col1,col2,..from b where (substring(createtime,1,8) between '20030829' and '20030904')

解决方案 »

  1.   

    insert a (除了标识列的列) SELECT 除了标识列的列 FROM b where (substring(createtime,1,8) between '20030829' and '20030904')
      

  2.   

    标识列是自增的,不能用这样语句!
    insert into a(没有标识列的所有列) select 没有标识列的所有列 where ...
      

  3.   

    a.b表中都存在自增长字段
    1、insert into a(列名) SELECT 列名 FROM b where (substring(createtime,1,8) between '20030829' and '20030904')自增长字段除外
    2、 set identity_insert 表名 off