CNCEC_SUBQHSE_WUHUAN/DataBase/初始化及数据迁移/SGGL(WH)20210312数据迁移脚本/1、会议.sql

41 lines
3.6 KiB
Transact-SQL

/*°²È«»áÒé*/
insert into SGGLDB.dbo.Meeting_AttendMeeting(AttendMeetingId,ProjectId,AttendMeetingCode,AttendMeetingName,AttendMeetingDate,CompileMan,AttendMeetingContents,CompileDate
,States,MeetingHours,MeetingHostMan,AttentPerson,MeetingPlace,UnitId,MeetingHostManId,AttentPersonIds,AttentPersonNum)
select AttendMeetingId,ProjectId,AttendMeetingCode,AttendMeetingName,AttendMeetingDate,CompileMan,AttendMeetingContents,CompileDate
,States,MeetingHours,MeetingHostMan,AttentPerson,MeetingPlace,UnitId,MeetingHostManId,AttentPersonIds,AttentPersonNum
from SUBHSSEDB.dbo.Meeting_AttendMeeting as s
where s.ProjectId in (select ProjectId from SGGLDB.dbo.Base_Project)
AND s.AttendMeetingId NOT IN (select AttendMeetingId from SGGLDB.dbo.Meeting_AttendMeeting)
go
insert into SGGLDB.dbo.Meeting_ClassMeeting(ClassMeetingId,ProjectId,ClassMeetingCode,ClassMeetingName,ClassMeetingDate,CompileMan,ClassMeetingContents,CompileDate
,States,MeetingHours,MeetingHostMan,AttentPerson,MeetingPlace,UnitId,AttentPersonNum)
select ClassMeetingId,ProjectId,ClassMeetingCode,ClassMeetingName,ClassMeetingDate,CompileMan,ClassMeetingContents,CompileDate
,States,MeetingHours,MeetingHostMan,AttentPerson,MeetingPlace,UnitId,AttentPersonNum
from SUBHSSEDB.dbo.Meeting_ClassMeeting as s
where s.ProjectId in (select ProjectId from SGGLDB.dbo.Base_Project)
AND s.ClassMeetingId NOT IN (select ClassMeetingId from SGGLDB.dbo.Meeting_ClassMeeting)
go
insert into SGGLDB.dbo.Meeting_MonthMeeting(MonthMeetingId,ProjectId,MonthMeetingCode,MonthMeetingName,MonthMeetingDate,CompileMan,MonthMeetingContents,CompileDate
,States,MeetingHours,MeetingHostMan,AttentPerson,MeetingPlace,UnitId,MeetingHostManId,AttentPersonIds,AttentPersonNum)
select MonthMeetingId,ProjectId,MonthMeetingCode,MonthMeetingName,MonthMeetingDate,CompileMan,MonthMeetingContents,CompileDate
,States,MeetingHours,MeetingHostMan,AttentPerson,MeetingPlace,UnitId,MeetingHostManId,AttentPersonIds,AttentPersonNum
from SUBHSSEDB.dbo.Meeting_MonthMeeting as s
where s.ProjectId in (select ProjectId from SGGLDB.dbo.Base_Project)
AND s.MonthMeetingId NOT IN (select MonthMeetingId from SGGLDB.dbo.Meeting_MonthMeeting)
go
insert into SGGLDB.dbo.Meeting_SpecialMeeting(SpecialMeetingId,ProjectId,SpecialMeetingCode,SpecialMeetingName,SpecialMeetingDate,CompileMan,SpecialMeetingContents,CompileDate
,States,MeetingHours,MeetingHostMan,AttentPerson,MeetingPlace,UnitId,MeetingHostManId,AttentPersonIds,AttentPersonNum)
select SpecialMeetingId,ProjectId,SpecialMeetingCode,SpecialMeetingName,SpecialMeetingDate,CompileMan,SpecialMeetingContents,CompileDate
,States,MeetingHours,MeetingHostMan,AttentPerson,MeetingPlace,UnitId,MeetingHostManId,AttentPersonIds,AttentPersonNum
from SUBHSSEDB.dbo.Meeting_SpecialMeeting as s
where s.ProjectId in (select ProjectId from SGGLDB.dbo.Base_Project)
AND s.SpecialMeetingId NOT IN (select SpecialMeetingId from SGGLDB.dbo.Meeting_SpecialMeeting)
go
insert into SGGLDB.dbo.Meeting_WeekMeeting(WeekMeetingId,ProjectId,WeekMeetingCode,WeekMeetingName,WeekMeetingDate,CompileMan,WeekMeetingContents,CompileDate
,States,MeetingHours,MeetingHostMan,AttentPerson,MeetingPlace,UnitId,MeetingHostManId,AttentPersonIds,AttentPersonNum)
select WeekMeetingId,ProjectId,WeekMeetingCode,WeekMeetingName,WeekMeetingDate,CompileMan,WeekMeetingContents,CompileDate
,States,MeetingHours,MeetingHostMan,AttentPerson,MeetingPlace,UnitId,MeetingHostManId,AttentPersonIds,AttentPersonNum
from SUBHSSEDB.dbo.Meeting_WeekMeeting as s
where s.ProjectId in (select ProjectId from SGGLDB.dbo.Base_Project)
AND s.WeekMeetingId NOT IN (select WeekMeetingId from SGGLDB.dbo.Meeting_WeekMeeting)
go