/****** Script for SelectTopNRows command from SSMS  ******/
SELECT TOP 300 [Status]
      ,[No_Proposal]
      ,[Nama_Perusahaan]
      ,[No_Polis]
      ,[Tgl_Mulai]
      ,[Tgl_Selesai]
  FROM [db_no_replicate_space].[dbo].[temp_prib_list_polis_ajb]

SELECT
	pp.Create_By,
	pp.Change_Date,
	pp.Create_Date,
	pp.Change_Date
FROM
	[db_no_replicate_space].[dbo].[temp_prib_list_polis_ajb] AS tmp INNER JOIN
	dbo.Produk_Polis AS pp ON tmp.No_Proposal = pp.No_Proposal
ORDER BY
  pp.Change_Date

-- backup
--SELECT
--	kbp.*
--INTO
--  [db_no_replicate_space].[dbo].[temp_prib_Kelas_Benefit_Polis]
--FROM
--	[db_no_replicate_space].[dbo].[temp_prib_list_polis_ajb] AS tmp INNER JOIN
--	dbo.Produk_Polis AS pp ON tmp.No_Proposal = pp.No_Proposal INNER JOIN
--	dbo.Kelas_Benefit_Polis AS kbp ON pp.Id_Produk = kbp.Id_Produk
--WHERE
--  pp.Sub_Kelompok = '0100'

--SELECT
--	pp2.*
--INTO
--  [db_no_replicate_space].[dbo].[temp_prib_Premi_Polis]
--FROM
--	[db_no_replicate_space].[dbo].[temp_prib_list_polis_ajb] AS tmp INNER JOIN
--	dbo.Produk_Polis AS pp ON tmp.No_Proposal = pp.No_Proposal INNER JOIN
--	dbo.Premi_Polis AS pp2 ON pp.Id_Produk = pp2.Id_Produk
--WHERE
--  pp.Sub_Kelompok = '0100'

