SELECT * FROM GrpInsurance.dbo.Peserta WHERE No_Proposal = '2016.0253' AND Status = 'I' AND Sebagai = 0
SELECT * FROM GrpInsuranceUAT.dbo.Peserta WHERE No_Proposal = '2016.0253' AND Status = 'I' AND Sebagai = 0

SELECT * FROM GrpInsurance.dbo.Peserta WHERE No_Proposal = '2016.0253' AND Status = 'I' AND No_Peserta NOT IN (SELECT No_Peserta FROM GrpInsuranceUAT.dbo.Peserta WHERE No_Proposal = '2016.0253' AND Status = 'I')
SELECT * FROM GrpInsurance.dbo.Peserta_Produk WHERE No_Proposal = '2016.0253' AND No_Peserta IN (SELECT No_Peserta FROM GrpInsurance.dbo.Peserta WHERE No_Proposal = '2016.0253' AND Status = 'I' AND No_Peserta NOT IN (SELECT No_Peserta FROM GrpInsuranceUAT.dbo.Peserta WHERE No_Proposal = '2016.0253' AND Status = 'I'))
SELECT * FROM GrpInsurance.dbo.Peserta_Produk_Detail WHERE No_Proposal = '2016.0253' AND No_Peserta IN (SELECT No_Peserta FROM GrpInsurance.dbo.Peserta WHERE No_Proposal = '2016.0253' AND Status = 'I' AND No_Peserta NOT IN (SELECT No_Peserta FROM GrpInsuranceUAT.dbo.Peserta WHERE No_Proposal = '2016.0253' AND Status = 'I'))

INSERT INTO GrpInsuranceUAT.dbo.Peserta_Produk
        (No_Proposal,
         No_Peserta,
         Id_Produk,
         Sub_Kelompok,
         Tgl_Mulai,
         Tgl_Selesai,
         Tgl_Ubah,
         Pay_Date,
         Next_Pay,
         No_Induk,
         Kelas,
         Resiko,
         Benefit,
         Premi,
         Santunan,
         Status,
         Ekstra_Premi,
         Curr_Premi,
         Curr_Santunan,
         Santunan_Duka,
         Santunan_Cacat,
         Santunan_Lain,
         Kelamin_Old,
         Usia_Old,
         Status_Kawin_Old,
         Cabang_Old,
         Kelas_Old,
         Resiko_Old,
         Benefit_Old,
         Premi_Old,
         Santunan_Old,
         Status_Old,
         Ekstra_Premi_Old,
         Curr_Premi_Old,
         Curr_Santunan_Old,
         Santunan_Duka_Old,
         Santunan_Cacat_Old,
         Santunan_Lain_Old,
         Adm_Keluar,
         Jml_Klaim,
         Create_By,
         Create_Date,
         Change_By,
         Change_Date,
         Tgl_Trans,
         Jumlah,
         Jenis,
         Prop_Santunan,
         adm_prosen)
SELECT 
    No_Proposal,
    No_Peserta,
    Id_Produk,
    Sub_Kelompok,
    Tgl_Mulai,
    Tgl_Selesai,
    Tgl_Ubah,
    Pay_Date,
    Next_Pay,
    No_Induk,
    Kelas,
    Resiko,
    Benefit,
    Premi,
    Santunan,
    Status,
    Ekstra_Premi,
    Curr_Premi,
    Curr_Santunan,
    Santunan_Duka,
    Santunan_Cacat,
    Santunan_Lain,
    Kelamin_Old,
    Usia_Old,
    Status_Kawin_Old,
    Cabang_Old,
    Kelas_Old,
    Resiko_Old,
    Benefit_Old,
    Premi_Old,
    Santunan_Old,
    Status_Old,
    Ekstra_Premi_Old,
    Curr_Premi_Old,
    Curr_Santunan_Old,
    Santunan_Duka_Old,
    Santunan_Cacat_Old,
    Santunan_Lain_Old,
    Adm_Keluar,
    Jml_Klaim,
    Create_By,
    Create_Date,
    Change_By,
    Change_Date,
    Tgl_Trans,
    Jumlah,
    Jenis,
    Prop_Santunan,
    adm_prosen 
FROM GrpInsurance.dbo.Peserta_Produk WHERE No_Proposal = '2016.0253' AND No_Peserta IN (SELECT No_Peserta FROM GrpInsurance.dbo.Peserta WHERE No_Proposal = '2016.0253' AND Status = 'I' AND No_Peserta NOT IN (SELECT No_Peserta FROM GrpInsuranceUAT.dbo.Peserta WHERE No_Proposal = '2016.0253' AND Status = 'I'))

INSERT INTO GrpInsuranceUAT.dbo.Peserta_Produk_Detail
        (No_Ref,
         No_Peserta,
         Id_Produk,
         Tgl_Mulai,
         Tgl_Selesai,
         Tgl_Ubah,
         Pay_Date,
         Status,
         No_Proposal,
         Sub_Kelompok,
         Kelamin,
         Usia,
         Status_Kawin,
         No_Induk,
         Sebagai,
         Cabang,
         Kelas,
         Resiko,
         Benefit,
         Premi,
         Santunan,
         Ekstra_Premi,
         Curr_Premi,
         Curr_Santunan,
         Santunan_Duka,
         Santunan_Cacat,
         Santunan_Lain,
         Kelamin_Old,
         Usia_Old,
         Status_Kawin_Old,
         Cabang_Old,
         Kelas_Old,
         Resiko_Old,
         Benefit_Old,
         Premi_Old,
         Santunan_Old,
         Ekstra_Premi_Old,
         Curr_Premi_Old,
         Curr_Santunan_Old,
         Santunan_Duka_Old,
         Santunan_Cacat_Old,
         Santunan_Lain_Old,
         Adm_Keluar,
         Jml_Klaim,
         Jumlah,
         Jenis,
         Status1,
         Change_By,
         Change_Date,
         Create_By,
         Create_Date,
         adm_prosen)
SELECT 
  No_Ref,
  No_Peserta,
  Id_Produk,
  Tgl_Mulai,
  Tgl_Selesai,
  Tgl_Ubah,
  Pay_Date,
  Status,
  No_Proposal,
  Sub_Kelompok,
  Kelamin,
  Usia,
  Status_Kawin,
  No_Induk,
  Sebagai,
  Cabang,
  Kelas,
  Resiko,
  Benefit,
  Premi,
  Santunan,
  Ekstra_Premi,
  Curr_Premi,
  Curr_Santunan,
  Santunan_Duka,
  Santunan_Cacat,
  Santunan_Lain,
  Kelamin_Old,
  Usia_Old,
  Status_Kawin_Old,
  Cabang_Old,
  Kelas_Old,
  Resiko_Old,
  Benefit_Old,
  Premi_Old,
  Santunan_Old,
  Ekstra_Premi_Old,
  Curr_Premi_Old,
  Curr_Santunan_Old,
  Santunan_Duka_Old,
  Santunan_Cacat_Old,
  Santunan_Lain_Old,
  Adm_Keluar,
  Jml_Klaim,
  Jumlah,
  Jenis,
  Status1,
  Change_By,
  Change_Date,
  Create_By,
  Create_Date,
  adm_prosen
FROM GrpInsurance.dbo.Peserta_Produk_Detail WHERE No_Proposal = '2016.0253' AND No_Peserta IN (SELECT No_Peserta FROM GrpInsurance.dbo.Peserta WHERE No_Proposal = '2016.0253' AND Status = 'I' AND No_Peserta NOT IN (SELECT No_Peserta FROM GrpInsuranceUAT.dbo.Peserta WHERE No_Proposal = '2016.0253' AND Status = 'I'))

INSERT INTO GrpInsuranceUAT.dbo.Peserta
        (No_Proposal,
         No_Peserta,
         No_Prs,
         No_Lama,
         Nama,
         Card_Name,
         Tgl_Lahir,
         Usia,
         Status_Kawin,
         Kelamin,
         Sebagai,
         No_Induk,
         Nik,
         Jabatan,
         Cabang,
         Departemen,
         Divisi,
         Grade,
         Pln,
         Kelas,
         Adm_Keluar_Ok,
         Tgl_Masuk,
         Tgl_Mulai,
         Tgl_Selesai,
         Health_Dec,
         Periode_Bayar,
         Mata_Uang,
         Faktor,
         Tgl_Lapse,
         Rate,
         Status,
         Create_By,
         Create_Date,
         Change_By,
         Change_Date,
         Keterangan,
         Rek_No,
         Rek_Nama,
         Bank_Nama,
         Bank_Cabang,
         no_telepon,
         email,
         id_area,
         id_country)
SELECT 
  No_Proposal,
  No_Peserta,
  No_Prs,
  No_Lama,
  Nama,
  Card_Name,
  Tgl_Lahir,
  Usia,
  Status_Kawin,
  Kelamin,
  Sebagai,
  No_Induk,
  Nik,
  Jabatan,
  Cabang,
  Departemen,
  Divisi,
  Grade,
  Pln,
  Kelas,
  Adm_Keluar_Ok,
  Tgl_Masuk,
  Tgl_Mulai,
  Tgl_Selesai,
  Health_Dec,
  Periode_Bayar,
  Mata_Uang,
  Faktor,
  Tgl_Lapse,
  Rate,
  Status,
  Create_By,
  Create_Date,
  Change_By,
  Change_Date,
  Keterangan,
  Rek_No,
  Rek_Nama,
  Bank_Nama,
  Bank_Cabang,
  no_telepon,
  email,
  id_area,
  id_country 
FROM GrpInsurance.dbo.Peserta WHERE No_Proposal = '2016.0253' AND Status = 'I' AND No_Peserta NOT IN (SELECT No_Peserta FROM GrpInsuranceUAT.dbo.Peserta WHERE No_Proposal = '2016.0253' AND Status = 'I')
