--SELECT * DELETE FROM custport_klaim  
--SELECT * DELETE FROM custport_klaim_aai
--SELECT * DELETE FROM custport_klaim_aai_history
--SELECT * DELETE FROM custport_klaim_detail
--SELECT * DELETE FROM custport_klaim_dokumen
--SELECT * DELETE FROM custport_klaim_email
--SELECT * DELETE FROM custport_klaim_history
--SELECT * DELETE FROM custport_payment_email
--SELECT * DELETE FROM custport_rekening_peserta

--SELECT * DELETE FROM custport_from_aai_header
--SELECT * DELETE FROM custport_from_aai_detail
--SELECT * DELETE FROM custport_svc_user_session_client WHERE session_expire> GETDATE()


--SELECT * DELETE FROM dbo.Note_Lunas_Master WHERE No_Ref IN (SELECT No_Ref FROM dbo.Klaim_Ref_Detail WHERE No_Klaim IN (SELECT No_Klaim FROM dbo.Klaim_Peserta WHERE No_Proposal='2016.0253'))
--SELECT * DELETE FROM dbo.Note_Lunas_Detail WHERE No_Ref IN (SELECT No_Ref FROM dbo.Klaim_Ref_Detail WHERE No_Klaim IN (SELECT No_Klaim FROM dbo.Klaim_Peserta WHERE No_Proposal='2016.0253'))

--SELECT * DELETE FROM dbo.Note_Terbit_Detail WHERE No_Ref IN (SELECT No_Ref FROM dbo.Klaim_Ref_Detail WHERE No_Klaim IN (SELECT No_Klaim FROM dbo.Klaim_Peserta WHERE No_Proposal='2016.0253'))
--SELECT * DELETE FROM dbo.Note_Terbit_Master WHERE No_Ref IN (SELECT No_Ref FROM dbo.Klaim_Ref_Detail WHERE No_Klaim IN (SELECT No_Klaim FROM dbo.Klaim_Peserta WHERE No_Proposal='2016.0253'))

SELECT * DELETE FROM dbo.Note_Terbit_Detail WHERE No_Ref IN (SELECT No_Ref FROM dbo.Note_Terbit_Master WHERE No_Proposal='2016.0253' AND Jenis=20)
SELECT * DELETE FROM dbo.Note_Terbit_Master WHERE No_Proposal='2016.0253' AND Jenis=20

--SELECT * DELETE krm FROM dbo.Klaim_Ref_Master AS krm INNER JOIN dbo.Klaim_Ref_Detail AS krd ON krm.No_Ref = krd.No_Ref AND krm.No_Klaim = krd.No_Klaim WHERE krd.No_Klaim IN (SELECT No_Klaim FROM dbo.Klaim_Peserta WHERE No_Proposal='2016.0253')
--SELECT * DELETE FROM dbo.Klaim_Ref_Detail WHERE No_Klaim IN (SELECT No_Klaim FROM dbo.Klaim_Peserta WHERE No_Proposal='2016.0253')
--SELECT * DELETE FROM dbo.Klaim_Detail WHERE No_Klaim IN (SELECT No_Klaim FROM dbo.Klaim_Peserta WHERE No_Proposal='2016.0253')
--SELECT * DELETE FROM dbo.Klaim_Peserta WHERE No_Proposal='2016.0253'
