日期:2014-05-18 浏览次数:20510 次
insert into B.dbo.PODetails(FormID) select distinct ID from A.dbo.POS where FormDate=@FormDate
------解决方案--------------------
SET IDENTITY_INSERT b..POS ON
insert into b..POS(id , FormDate) select id , FormDate from a..pos where FormDate = @FormDate
SET IDENTITY_INSERT b..POS OFF
SET IDENTITY_INSERT b..PODetails ON
insert into b..PODetails(id , formid) select m.id , m.formid from a..PODetails m,a..pos n where m.formid = n.id and n.formdate = @formdate
SET IDENTITY_INSERT b..PODetails OFF