SELECT 
      ID,
      [Plan Code],
      [id plan dasar],
      [id plan],
      Currency,
      [periode bayar],
      Class,
      Risiko,
      [sex ttg],
      [sex ppm],
      [usia ttg],
      [usia ppm],
      [MK dasar],
      [MPP dasar],
      [UP dasar],
      [Premi dasar],
      [MK plan],
      [MPP plan],
      [UP plan],
      [tgl produksi & tgl mulai],
      Rate--,
      --dbo.func_getpremi([id plan dasar],[id plan],Currency,[periode bayar],Class,Risiko,[sex ttg],[sex ppm],[usia ttg],[usia ppm],[MK dasar],[MPP dasar],[UP dasar],[Premi dasar],[MK plan],[MPP plan],[UP plan],[tgl produksi & tgl mulai],[tgl produksi & tgl mulai]) AS Premi_dasar
FROM temp_prib

SELECT DISTINCT [periode bayar]
FROM temp_prib  -- 661791
--WHERE [Premi dasar] IS NULL
SELECT COUNT(*) FROM dbo.temp_prib WHERE status='error'
SELECT * FROM dbo.temp_prib WHERE status<>'oke'

--UPDATE
--  dbo.temp_prib
--SET
--  Premi = dbo.func_getpremi([id plan dasar],[id plan],Currency,[periode bayar],Class,Risiko,[sex ttg],[sex ppm],[usia ttg],[usia ppm],[MK dasar],[MPP dasar],[UP dasar],[Premi dasar],[MK plan],[MPP plan],[UP plan],[tgl produksi & tgl mulai],[tgl produksi & tgl mulai])
--FROM
--  dbo.temp_prib
--WHERE
--  Premi IS NULL
  --Currency='IDR'
  
