use Y
insert into 表1 select a.id,a.name,a.sex,a.telephone,b.class from X.dbo.表a a inner join X.dbo.表b b on a.id=b.id where a.workdate<='2008-10-31'
insert into 表2 select a.id,b.workdetail,a.workdate,a.birthday,a.address from X.dbo.表a a inner join X.dbo.表b b on a.id=b.id where a.workdate<='2008-10-31'
------解决方案-------------------- 用 insert into .....selct * from X..表 where workdate<='2008-10-31' insert into .....selct * from x..表 where workdate>='2008-11-1'
如果有自增列,插入记录前用set identity_insert off 命令将自增属性关闭,插入记录后 再set identity_insert on将属性撕开