Files
SGGL_SHJ/DataBase/版本日志/已更新脚本/初始化及数据迁移/2020-07-05HSSE-数据迁移脚本.sql
T

71 lines
4.1 KiB
Transact-SQL
Raw Normal View History

2022-09-05 16:36:31 +08:00
insert into SGGLDB.dbo.Solution_SolutionTemplate select * from HSSEDB.dbo.Solution_SolutionTemplate
where ProjectId in (select ProjectId from SGGLDB.dbo.Base_Project)
go
insert into SGGLDB.dbo.Solution_ConstructSolution select * from HSSEDB.dbo.Solution_ConstructSolution
where ProjectId in (select ProjectId from SGGLDB.dbo.Base_Project)
go
insert into SGGLDB.dbo.Solution_LargerHazard select * from HSSEDB.dbo.Solution_LargerHazard
where ProjectId in (select ProjectId from SGGLDB.dbo.Base_Project)
go
insert into SGGLDB.dbo.Solution_ExpertArgument select * from HSSEDB.dbo.Solution_ExpertArgument
where ProjectId in (select ProjectId from SGGLDB.dbo.Base_Project)
go
insert into SGGLDB.dbo.Technique_ProjectSolutionTemplete select * from HSSEDB.dbo.Technique_ProjectSolutionTemplete
go
insert into SGGLDB.dbo.Training_Plan select * from HSSEDB.dbo.Training_Plan
where ProjectId in (select ProjectId from SGGLDB.dbo.Base_Project)
go
insert into SGGLDB.dbo.EduTrain_TrainRecord select * from HSSEDB.dbo.EduTrain_TrainRecord
where ProjectId in (select ProjectId from SGGLDB.dbo.Base_Project)
go
insert into SGGLDB.dbo.EduTrain_TrainRecordDetail select * from HSSEDB.dbo.EduTrain_TrainRecordDetail
where TrainingId in (select TrainingId from SGGLDB.dbo.EduTrain_TrainRecord)
go
insert into SGGLDB.dbo.OccupationHealth_HazardDetection select * from HSSEDB.dbo.OccupationHealth_HazardDetection
where ProjectId in (select ProjectId from SGGLDB.dbo.Base_Project)
go
insert into SGGLDB.dbo.OccupationHealth_OccupationalDiseaseAccident select * from HSSEDB.dbo.OccupationHealth_OccupationalDiseaseAccident
where ProjectId in (select ProjectId from SGGLDB.dbo.Base_Project)
go
insert into SGGLDB.dbo.OccupationHealth_PhysicalExamination select * from HSSEDB.dbo.OccupationHealth_PhysicalExamination
where ProjectId in (select ProjectId from SGGLDB.dbo.Base_Project)
go
insert into SGGLDB.dbo.Environmental_UnexpectedEnvironmental select * from HSSEDB.dbo.Environmental_UnexpectedEnvironmental
where ProjectId in (select ProjectId from SGGLDB.dbo.Base_Project)
go
insert into SGGLDB.dbo.Environmental_EnvironmentalMonitoring select * from HSSEDB.dbo.Environmental_EnvironmentalMonitoring
where ProjectId in (select ProjectId from SGGLDB.dbo.Base_Project)
go
insert into SGGLDB.dbo.Environmental_EnvironmentalEmergencyPlan select * from HSSEDB.dbo.Environmental_EnvironmentalEmergencyPlan
where ProjectId in (select ProjectId from SGGLDB.dbo.Base_Project)
go
insert into SGGLDB.dbo.Environmental_EIAReport select * from HSSEDB.dbo.Environmental_EIAReport
where ProjectId in (select ProjectId from SGGLDB.dbo.Base_Project)
go
insert into SGGLDB.dbo.SitePerson_DayReport select * from HSSEDB.dbo.SitePerson_DayReport
where ProjectId in (select ProjectId from SGGLDB.dbo.Base_Project)
go
insert into SGGLDB.dbo.SitePerson_DayReportDetail select * from HSSEDB.dbo.SitePerson_DayReportDetail
where DayReportId in (select DayReportId from SGGLDB.dbo.SitePerson_DayReport)
go
insert into SGGLDB.dbo.SitePerson_DayReportUnitDetail select * from HSSEDB.dbo.SitePerson_DayReportUnitDetail
where DayReportDetailId in (select DayReportDetailId from SGGLDB.dbo.SitePerson_DayReportDetail)
go
insert into SGGLDB.dbo.SitePerson_MonthReport select * from HSSEDB.dbo.SitePerson_MonthReport
where ProjectId in (select ProjectId from SGGLDB.dbo.Base_Project)
go
insert into SGGLDB.dbo.SitePerson_MonthReportDetail select * from HSSEDB.dbo.SitePerson_MonthReportDetail
where MonthReportId in (select MonthReportId from SGGLDB.dbo.SitePerson_MonthReport)
go
insert into SGGLDB.dbo.SitePerson_MonthReportUnitDetail select * from HSSEDB.dbo.SitePerson_MonthReportUnitDetail
where MonthReportDetailId in (select MonthReportDetailId from SGGLDB.dbo.SitePerson_MonthReportDetail)
go
insert into SGGLDB.dbo.SitePerson_Checking select * from HSSEDB.dbo.SitePerson_Checking
where ProjectId in (select ProjectId from SGGLDB.dbo.Base_Project)
go
insert into SGGLDB.dbo.SitePerson_PersonInOut select * from HSSEDB.dbo.SitePerson_PersonInOut
where PersonId in (select PersonId from SGGLDB.dbo.SitePerson_Person)
go
insert into SGGLDB.dbo.SitePerson_PersonInOutNumber select * from HSSEDB.dbo.SitePerson_PersonInOutNumber
where ProjectId in (select ProjectId from SGGLDB.dbo.Base_Project)
go