SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE email_tagihan_kewajiban_init
	@Id_User VARCHAR(4),
	@Msg VARCHAR(100)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	
	IF EXISTS(SELECT 1 FROM )

  INSERT INTO dbo.email_tagihan_kewajiban_proses
          (proses_ya,
           No_Polis,
           Nama_Perusahaan,
           Broker_Nama,
           Contact_Name,
           e_mail,
           proses_status,
           pdf_created,
           email_sent,
           create_by,
           create_date)
  SELECT
    0, -- proses_ya - bit
    No_Polis, -- No_Polis - varchar(11)
    Nama_Perusahaan, -- Nama_Perusahaan - varchar(50)
    Broker_Nama, -- Broker_Nama - varchar(50)
    Contact_Name, -- Contact_Name - varchar(30)
    e_mail, -- e_mail - varchar(50)
    0, -- proses_status - tinyint
    NULL, -- pdf_created - datetime
    NULL, -- email_sent - datetime
    @Id_User, -- create_by - varchar(4)
    GETDATE()  -- create_date - datetime
  FROM
	  dbo.view_Email_Tagihan_Kewajiban
  
END
GO
