@idplandasar, 
@idplan, 
@idvalas, 
@idprbayar, 1 (bulanan)
@kelas, 
@resiko, 
@sexttg, -- jika plan dasar=cowok, rider jika null==bebas
@sexppm, 
@usiattg, 
@usiappm, 
@mkdasar, -- 20
@mpdasar, -- premium payment
@updasar, -- sum assure
@premidasar,  -- sum assure
@premiberkala,  -- sum assure
@topupberkala,  -- sum assure
@mk, -- 20
@mp, -- premium payment
@up, -- sum assure
@tglprod, -- Effective Date From
@tglmulai, -- Effective Date From
@pi_thn_ke -- Policy Year From atau 1 jika 0

--UPDATE
--  dbo.temp_prib_rider
--SET
--  Gender = NULL
--WHERE
--  Gender = 'NULL'
  
--UPDATE
--  dbo.temp_prib_rider
--SET
--  [Premium Payment Term] = NULL
--WHERE
--  [Premium Payment Term] = 'NULL'

SELECT * FROM dbo.jenis_kelamin

SELECT
  [ID Plan PL],
  [ID Plan SQL],
  Currency,
  Policy,
  Gender,
  [Premium Payment Term],
  [Effective Date From],
  [Effective Date To],
  [Entry Age From],
  [Entry Age To],
  [Occupation Class],
  Risk,
  [Policy Year From],
  [Policy Year To],
  [Sum Assured],
  Factor,
  [Rate COI PL],
  [Rate COI  IT],
  dbo.func_getpreminew([ID Plan SQL],[ID Plan SQL],Currency,1,[Occupation Class],Risk,'L','L',[Entry Age From],[Entry Age From],20,[Premium Payment Term],[Sum Assured],[Sum Assured],[Sum Assured],[Sum Assured],20,[Premium Payment Term],[Sum Assured],[Effective Date From],[Effective Date From],1) AS Rate_COI_IT
FROM
  dbo.temp_prib2

UPDATE
  dbo.temp_prib2
SET
  [Rate COI  IT] = dbo.func_getpreminew([ID Plan SQL],[ID Plan SQL],Currency,1,[Occupation Class],Risk,'L','L',[Entry Age From],[Entry Age From],20,[Premium Payment Term],[Sum Assured],[Sum Assured],[Sum Assured],[Sum Assured],20,[Premium Payment Term],[Sum Assured],[Effective Date From],[Effective Date From],1)
-- (17669 row(s) affected)

SELECT
  *
FROM
  dbo.temp_prib_rider
WHERE [Rate COI PL]<>[Rate COI  IT]
----
DECLARE
  @belum FLOAT,
  @sudah FLOAT,
  @total FLOAT
SELECT
  @belum=COUNT(*)
FROM
  dbo.temp_prib_rider
WHERE [Rate COI  IT] IS NULL
SELECT
  @sudah=COUNT(*)
FROM
  dbo.temp_prib_rider
WHERE [Rate COI  IT] IS NOT NULL
SET @total = @belum + @sudah
SELECT (@sudah/@total)*100

DELETE FROM dbo.temp_prib_rider

SELECT
  *
FROM
  dbo.temp_prib_basic